This is not a substitute for official poetry documentation, but a reference for commonly used commands, etc.
Use poetry shell
.
You may be used to running source venv/bin/activate
to work inside of your virtual
environment. This is not necessary.
However, if you need to know about your virtual environment (for example, to configure your project interpreter in your IDE), you can get the path by using the command:
poetry env info
The output will contain a Path
field.
Please refer to the official poetry dependency management documentation, which essentially encompasses the following commands:
add
show
remove
First, consider whether your dependency needs to be available at runtime, or if it is only used in testing or development.
If it is a runtime dependency, use the command: poetry add dependency-name
If it is a development or testing dependency, use the
command: poetry add -D dependency-name
If you need to change this, you can edit pyproject.toml.