Install + Use Poetry#
> curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
Check to see what version Poetry is.
> poetry --version
Start a new Python project with Poetry#
Head to the parent directory where you want the new project to live.
> poetry new project-name
This will create a directory called project-name with everything you need! The
pyproject.toml file has everything in it for your project’s dependencies.
Add some dependencies.
> poetry add pandas
This will add them to
pyproject.tomlso you don’t need to do that manually. It will also add and install all of the requirements for the package you just added.
Remove a dependency.
> poetry remove pandas
Use Poetry to run Python. (This is like activating your virtual environment.) In your terminal, type
poetry runbefore the
> poetry run python python-script.py