Show Menu
Cheatography

virtualenv Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Pipenv (Higher level)

Install
pip install pipenv
Change to directory
cd projec­t_f­older
Install packages
pipenv install requests
Running
pipenv run python main.py
 
pipenv shell

virtualenv (Lower level)

Install
pip install virtualenv
Change to directory
cd projec­t_f­older
Create folder with py execs & copy of pip
virtualenv venv
 
(Ignoring name for venv places files in current directory)
Choose interp­reter
virtualenv -p <Path to interp­ret­er> venv
Activate venv
call venv\S­cri­pts­\ac­tiv­ate.bat
Deactivate
deactivate
Delete venv
rm -rf projec­t_f­older
Clean package list
virtualenv --no-s­ite­-pa­ckages venv
Give access to global site-p­ackages
virtualenv --syst­em-­sit­e-p­ackages venv
Create requir­ement file
pip freeze > requir­eme­nts.txt
 

virtua­len­vwr­apper

Install
pip install virtua­len­vwr­app­er-win
Windows default path for WORKON­_HOME
%USERP­ROF­ILE­%\Envs
Create virtualenv
mkvirt­ualenv projec­t_f­older
Work on a virenv
workon projec­t_f­older
Both in one command
mkproject projec­t_f­older
Deactivate a venv
deactivate
Delete a venv
rmvirt­ualenv venv
Other commands:
lsvirt­ualenv
- List all enviro­nments
cdvirt­ualenv
- Navigate to currently activated virenv