minte9
LearnRemember



Virtual Env

A virtual environment is an isolated Python system.
 
python -m pip install --upgrade pip
pip install virtualenv

virtualenv ./my_env     # create

. my_env/bin/activate   # load and activate
pip list                # test env     
deactivate              # exit env

source my_env/bin/activate # second method
pip list
deactivate

: '
Package    Version
---------- -------
pip        22.3.1
setuptools 65.6.3
wheel      0.38.4
'
        
echo 'my_env/' > .gitignore

Venv

Use the venv module which is included in the standard library.
 
python3 -m venv myenv

myenv\Scripts\activate # windows

source myenv/bin/activate # linux



  Last update: 286 days ago