Created
March 24, 2019 12:27
-
-
Save mujeebishaque/afdcdb23e95975870adefd21b11cf93a to your computer and use it in GitHub Desktop.
Learning Summary of pipenv and poetry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install pipenv by | |
>pip install pipenv | |
>move to working dir | |
>pipenv install requests python-box # install 2 packages | |
you can specify the version of python by | |
pipenv install --three | |
# --three means to use python 3 | |
it will create the virutal env somewhere it resides in .local dir or whatever | |
it will install dependencies in the virtual env. | |
it will create a pipfile for the project. | |
it will create a pipfile.lock too. | |
the pip file will contain the 2 dependencies we installed | |
you can see the pipfile by >type pipfile | |
pipenv run python file_name.py# it will run the program | |
pipenv shell will get on in a virtual shell like workon | |
type > exit to deactive | |
__________________________________________ | |
POETRY | |
__________________________________________ | |
create a new project | |
__________________ | |
>poetry new currencies | |
# currencies is the name of project. | |
# it will create a new folder with .toml files and others. Folder would be named currencies and it will have currencies subfolder having .init files and stuff | |
>cd currencies | |
>poetry add requests python-box | |
>poetry run python currencies/python_file.py | |
>poetry shell | |
.lock files make stuff deterministic and complete. | |
------------------------------------------------------- | |
Personal Opinion is to go for virtualenv | |
On windows. | |
>pip install virtualenv | |
>pip install virtualenvwrapper-win |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment