mkvirtualenv python 3 code example
Example 1: creating venv python3
mkdir project_folder
cd project_folder
python3.7 -m venv myvenv
virtualenv myvenv --python=python3.7
source myvenv/bin/activate
Example 2: virtualwrapper
$ pip install virtualenvwrapper
...
$ export WORKON_HOME=~/Envs
$ mkdir -p $WORKON_HOME
$ source /usr/local/bin/virtualenvwrapper.sh
$ mkvirtualenv env1
Installing
setuptools..........................................
....................................................
....................................................
...............................done.
virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/predeactivate
virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/postdeactivate
virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/preactivate
virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/postactivate New python executable in env1/bin/python
(env1)$ ls $WORKON_HOME
env1 hook.log
Example 3: create a virtual environment python 3
python3 -m venv /path/to/new/virtual/environment
Example 4: how to make a virtual environment python 3
python -m venv name_virtual_env
python3 -m venv name_virtual_env
source name_virtual_env/bin/activate
name_virtual_env\Scripts\activate
Example 5: create virtual env pyhton3
python3 -m venv /path/to/new/virtual/environment
Example 6: create a virtualenv python3
py -m venv env