When working with Python, it’s best practice to use a separate virtual environment for each project to avoid dependency conflicts. Tools like PyCharm create virtual environments automatically, but you can just as easily do it via the command line:
Once activated, your console should look like this:
(.venv) <user>@<computer> <FolderName>
Activate the virtual environment
source .venv/bin/activate
cd
to your project root and create a new virtual environmentRunning this command will create a .venv
folder (a common name, but you can customize it if needed):
python3 -m venv .venv
You can leave the virtual environment by executing deactivate
.
Author Of article : Timo Reusch Read full article