virtualenv to path on Windows 10

21,009

Solution 1

To install :

pip install --user virtualenv

To create a virtual environment (venv):

python -m virtualenv venv

To activate:

-cd venv
-cd Scripts
-activate.bat

to deactivate:

-deactivate.bat

to run venv again just type activate.bat

Note: had problems with the platformio integrated terminal, used cmd from within the folder. Hope this helps!

Solution 2

  1. create a virtual environment

    python -m virtualenv demoEnv

  2. Activate the environment

    demoEnv\Scripts\activate

  3. To deactivate

    deactivate

Share:
21,009
Admin
Author by

Admin

Updated on July 05, 2022

Comments

  • Admin
    Admin almost 2 years

    I have installed virtualenv (if I type "pip list" there is virtualenv (15.1.0)) and when I try to use it throws an error:

    virtualenv : The term 'virtualenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again

    At line:1 char:1

    + virtualenv  
    + ~~~~~~~~~~  
       + CategoryInfo          : ObjectNotFound: (virtualenv:String) [], CommandNotFoundException
       + FullyQualifiedErrorId : CommandNotFoundException
    

    I think I need to add virtualenv to path, which I've tried without success.