-
Notifications
You must be signed in to change notification settings - Fork 0
Virtual Environmnet
Alex edited this page Jun 18, 2024
·
4 revisions
Using a virtual environment helps us to control all packages and their versions.
We recommend the Poetry package, since it is a great tool for dependency management.
-
(optional) create virtual environments inside the project folder
poetry config virtualenvs.create true --local poetry config virtualenvs.in-project true --local
--local
can be ignored, if you wish to have these settings global. -
Install packages and create virtual environment
poetry install --no-root
-
Run the code via a single line of code
poetry run python main.py
or entering the virtual environment via
poetry shell
and then run the code inside the virtual environment via
python main.py
-
creating virtual environment
python -m venv .venv
-
activate
source .venv/bin/activate
-
install packages
python -m pip install requirements.txt
-
run
python main.py
-
If no longer needed deactivate it
deactivate
Here we want to provide an overview of the packages we use:
poetry show
provides a list of all packages