1.8 KiB
status: #doc #unfinished Tags: #python #env #programming links:python Date: 2023-04-26
virtual environment python
venv
making new env
- for making new virtual env use this command
python -m venv /path/to/new/virtual/environment
activating env
- activating env in bash/zsh
source <venv>/bin/activate
- activating in fish
source <venv>/bin/activate.fish
- activating in windows
PS C:\> <venv>\Scripts\Activate.ps1
deactivating env
- deactivating in all systems
(.venv)$ deactivate
Virtualenv
virtualenv
is a tool to create isolated Python environments , The venv
module does not offer all features of this library, venv is slower,not as extendable,- is not upgrade-able via pip,- does not have as rich programmatic API (describe virtual environments without creating them).
Installation
via pipx
pipx install virtualenv
virtualenv --help
other ways are not as good but if needed are in documentation
via zipapp
You can use Virtualenv without installing it too. pypa publish a Python zipapp, you can just download this from this link and invoke this package with a python interpreter:
python virtualenv.pyz --help
Poetry
References
https://dev.to/bowmanjd/python-tools-for-managing-virtual-environments-3bko#poetry https://dev.to/bowmanjd/getting-started-with-python-poetry-3ica