1. Virtualenv

1.1. venv Module

  • What is Virtualenv

1.2. Directory Naming Convention

  • No standard

Listing 1.1. Those names are common, but don’t have Python version
venv/
.venv/

virtualenv/
.virtualenv/
Listing 1.2. 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/
Listing 1.3. This convention is from virtualenv-wrapper module
~/.virtualenv/PROJECT_NAME/

1.3. Create Virtualenv

cd PROJECT_DIRECTORY
python3.7 -m venv venv-3.7

1.4. Activate Virtualenv

1.4.1. Windows

cd PROJECT_DIRECTORY
venv-3.7\Scripts\activate.bat

1.4.2. macOS, Linux, BSD

cd PROJECT_DIRECTORY
venv-3.7/bin/activate

1.5. Good practices

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