--Manage python package dependencies --You can build a virtual environment dedicated to the project ( --You can specify the dependent python version --You can specify the dependent package version --A tool similar to ruby bundle
https://python-poetry.org/docs/ Install with python script for mac
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
Install using pip
pip install --user poetry
If you set as below, the virtual environment will be created under the project folder, and vscode can automatically identify the python environment, so vscode intellisense will work.
poetry config virtualenvs.in-project true
Create pyproject.toml (like ruby gemfile) with the following command
poetry init
Install the dependent package into the virtual environment with the following command, and the dependent package is specified in pyproject.toml
poetry add pendulum
poetry add pendulum@^2.0.5 #If you also specify version
poetry add "pendulum>=2.0.5" #If you also specify version
poetry install
poetry update
poetry update fastapi
poetry shell
poetry run uvicorn main:app --reload
poetry show --tree
https://python-poetry.org/
Recommended Posts