How do you install virtualenv correctly on windows?
I downloaded virtualenv1.9.1 from here and tried installing it with:
python virtualenv.py install
but it does not appear in MyPythonPath/Scripts
I tried the same way installing virutalenvwrapper-win and it installed correctly. But I can't use it because I don't have virtualenv
python.exe: can't open file 'MyPythonPath\Scripts\virtualenv-script.py': [Errno 2 ] No such file or directory
To install virtualenv, just use pip install virtualenv . To create a virtual environment directory with it, type virtualenv /path/to/directory . Activating and deactivating the virtual environment works the same way as it does for virtual environments in Python 3 (see above).
Setting up virtualenv This can be done by activating the activate script in the Scripts folder. The following command creates an activate. bat batch file after activation. This creates an activate.
Installing virtualenvvenv is included in the Python standard library and requires no additional installation.
The suggested way to install Python packages is to use pip
Please follow this documentation to install pip
: https://pip.pypa.io/en/latest/installing/
Note: Python 2.7.9 and above, and Python 3.4 and above include pip already.
Then install virtualenv
:
pip install virtualenv
Since I got the same error as mentioned in the question inspite of installing with:
pip install virtualenv
I would like to add a few points, that might also help someone else solve the error in a similar way as me. Don't know if that's the best way, but for me nothing else helped.
pip install virtualenv
cd C:\Python27\Scripts
python virtualenv.exe my_env
my_env\Scripts\activate.bat
my_env\Scripts\deactivate.bat
install virtualenv
pip install virtualenv
create a virtual environment
python -m virtualenv demoEnv
Activate the environment
demoEnv\Scripts\activate
To deactivate
deactivate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With