Venv
tool
CLI
virtual environments
Venv is the built-in virtual environment manager for python.
Warning
Virtualenv and venv are not the same package. Venv is built into Python, while virtualenv is a third-party package that contains additional options.
Create and delete environments
- Create environment
-
python -m venv venv
- Removing / Deleting environment
-
conda env remove -n env-name
More info: Intro to Conda virtual environments
Use environment
- Use/activate environment
-
.\venv\Scripts\activate
- Deactive environment
-
deactivate
Install packages
- Install package using pip
-
pip install pandas
more info in Pip
- Export packages in env to requirements.txt
-
pip freeze > requirements.txt
- Install packages from requirements.txt
-
pip install -r requirements.txt