How to create a python virtual environment from the command line? [duplicate]

Linux/macos:
virtualenv -p python3 env
source env/bin/activate
pip install -r requirements.txt

windows:
virtualenv -p python3 env
env\scripts\activate
pip install -r requirements.txt

if you need to specify the full path to python you can use something like virtualenv -p C:\Program Files\Python36\python.exe myvirtualenv

Browse More Popular Posts

Leave a Comment