'python virtualenv on windows: Fatal error in launcher: Unable to create process using '"'

I have created a virtualenv in python 2.7 (Anaconda) on a dev machine and (after package installation) copied it to another windows machine in a PROD setting (no communication to outside). Executing any of the installed ".exe" entry points for a program in the virtualenv produces this error on the target machine however runs fine on the source machine:

(env) D:\app\pyvenv>env\Scripts\pip.exe
Fatal error in launcher: Unable to create process using '"'

The location of python installation on both machines is set to the same folder: C:\ProgramData\Anaconda2

Also see my additional notes at the bottom of this post. thanks



Solution 1:[1]

in my case, I previously changed the name of the python.exe executable to python3.exe so when I run:

virtualenv project1_env

it can't locate the python.exe if that was your case too .. just rename it again to python.exe and it should work.

Solution 2:[2]

In my case I uninstalled venv and then installed it again and it worked. pip uninstall virtualenv to uninstall it and use pip install virtualenv to install it again.

Solution 3:[3]

I had the same problem. Try making virtualenv with this command:

virtualenv --python C:\Path\To\Python\python.exe venv

Note that you should specify the path to your python installation folder after --python option.

Solution 4:[4]

In my case I solve by upgrading pip using following code in activate environment.

python -m pip install --upgrade pip

Solution 5:[5]

python -m pip install --upgrade pip

Run this while in the venv. seems like a system change occured and reinstalling it restores it to default.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Yash Tile
Solution 3 AlirezaAsadi
Solution 4 Suman Aryal
Solution 5 n1klaus