1. Virtualenv

1.1. venv Module

  • What is Virtualenv

1.2. Create Virtualenv

cd PROJECT_DIRECTORY
python3.7 -m venv venv-3.7.3

1.3. Directory Naming Convention

  • No standard naming convention

Listing 98. Those names are common, but don't have Python version
venv/
.venv/

virtualenv/
.virtualenv/
Listing 99. Those names has version, but lack of standard
.virtualenv-3.6/
.virtualenv-3.7/
.virtualenv-3.8/

.venv-3.6/
.venv-3.7/
.venv-3.8/

venv-3.6/
venv-3.7/
venv-3.8/

venv-3.7.1/
venv-3.7.2/
venv-3.7.3/

venv-3.8-beta1/
venv-3.8-beta2/
Listing 100. This convention is from virtualenv-wrapper module
~/.virtualenv/PROJECT_NAME/

1.4. Activate Virtualenv

1.4.1. Windows

cd PROJECT_DIRECTORY
venv-3.7.3\Scripts\activate.bat

1.4.2. macOS, Linux, BSD

cd PROJECT_DIRECTORY
venv-3.7.3/bin/activate

1.5. Good practices

  • name as version venv-3.7.3

  • place in your project directory

1.6. Assignments

1.6.1. Virtualenv

  • Lines of code to write: 0 lines

  • Estimated time of completion: 2 min

  1. Stwórz virtualenv z instalacją Python

  2. Dodaj virtualenv do Python Interpreter w Twoim IDE