python virtual environment what is it code example
Example 1: python virtual environment
python3 -m venv env
python -m virtualenv env
source env/bin/activate
Example 2: virtual environment python
pip install virtualenv
virtualenv pas
.\foldername\Scripts\activate
pip freeze
pip freeze > requirements.txt
pip install -r requirements.txt
virtualenv --system-site-packages-foldername
deactivate
Example 3: python env
python3 -m venv tutorial-env
tutorial-env\Scripts\activate.bat (window)
source tutorial-env/bin/activate (linux)
Example 4: create a virtualenv python3
py -m venv env