xxxxxxxxxx
python3 -m venv env
python -m virtualenv env #py2
source env/bin/activate
#all this is on same directory
xxxxxxxxxx
pip install virtualenv
# Creating a virtual env.
virtualenv myvirtualenv
# activating
source env/bin/activate
# on windows
.\env\Scripts\activate
xxxxxxxxxx
#PYTHON VENV FOR WINDOWS:
#Type first time in terminal
python -m venv env
#/\ name of venv
#Activate venv
env\Scripts\Activate.ps1
#/\ name of venv
#Deactivate venv
deactivate
xxxxxxxxxx
# Ubuntu/Debian
apt-get install python3-venv
python3 -m venv .venv
source .venv/bin/activate
# python 2
python -m virtualenv env
xxxxxxxxxx
python3 -m venv env # create env
source env/bin/activate # activate env
deactivate # deactivate env
rm -r env/ # delete env in Linux
pip freeze # show all packages installed
pip install -r requirements.txt # install all packages
pip freeze > requirements.txt # create automatically requirements.txt
xxxxxxxxxx
pip install virtualenv
python -m virtualenv env
# Run in Windows in first time
set-executionpolicy remotesigned
# then run
source env/bin/activate
# work in ubuntu
python3 -m venv myenv
image.mefiz.com
xxxxxxxxxx
# Create the virtual environment (here named 'env')
py -m venv myEnv
# Activate the venv
.\myEnv\Scripts\activate
# To confirm we are using the venv
where python #should print the python.exe within myEnv
# To leave the venv
deactivate
xxxxxxxxxx
# virtualenv package
pip install virtualenv # Install package
virtualenv djangoenv # Create a virtual environment
# venv package (default in django)
python3 -m venv djangoenv # Create a virtual environment
# Other commands
source djangoenv/bin/activate # Activate the virtual environment
deactivate # Deactivate the virtual environment
rm -r djangoenv/ # Delete the virtual environment
pip freeze # show all packages installed
pip list --format=columns # show all packages installed
pip install -r requirements.txt # install all packages
pip freeze > requirements.txt # create automatically requirements.txt
xxxxxxxxxx
py -m venv env ## For windows and Python 3
.\env\Scripts\activate
deactivate