Question :
Searching the net this seems to be a problem caused by spaces in the Python installation path.
How do I get pip
to work without having to reinstall everything in a path without spaces ?
Answer #1:
it seems that
python -m pip install XXX
will work anyway (worked for me)
(see link by user474491)
Answer #2:
On Windows at least, pip
stores the execution path in the executable pip.exe
when it is installed.
Edit this file using a hex editor or WordPad (you have to save it as plain text then to retain binary data), change the path to Python with quotes and spaces like this:
#!"C:Program Files (x86)Python33python.exe"
to an escaped path without spaces and quotes and pad with spaces (dots at the end should be spaces):
#!C:Progra~2Python33python.exe.............
For “C:Program Files”, this path would probably be “C:Progra~1” (shortened path names in DOS / Windows 3.x notation use tilde and numbers).
Windows provides this alternative notation for backwards compatibility with DOS / Windows 3.x apps.
Note that as this is a binary file, you should not change the file size which may break the executable, hence the padding.
Save with administrator privileges, make sure it is actually saved at the target location and try again.
You might also need to set the PATH
variable to use the ~
notation for the path to pip
.
Answer #3:
having the same trouble I read in https://pip.pypa.io/en/latest/installing.html#install-pip that to update pip it’s:
python -m pip install -U pip
So I made (for example)
python -m pip install virtualenv
And it worked! So you can do the same being ‘virtualenv’ another package you want.
Answer #4:
python -m pip
really works for the problem Fatal error in launcher: Unable to create process using '"'
.Worked on Windows 10
Answer #5:
I had a similar issue and upgrading pip fixed it for me.
python -m pip install --upgrade pip
This was on Windows and the path to python inside pip.exe was incorrect. See Archimedix answer for more information about the path.
Answer #6:
Here’s how I solved it:
-
open
pip.exe
in 7zip and extract__main__.py
to PythonScripts folder.In my case it was
C:Program Files (x86)Python27Scripts
-
Rename
__main__.py
topip.py
-
Run it!
python pip.py install something
EDIT:
If you want to be able to do pip install something
from anywhere, do this too:
-
rename pip.py to pip2.py (to avoid import pip errors)
-
make
C:Program Files (x86)Python27pip.bat
with the following contents:
python “C:Program Files (x86)Python27Scriptspip2.py” %1 %2 %3 %4
%5 %6 %7 %8 %9
-
add
C:Program Files (x86)Python27
to your PATH (if is not already) -
Run it!
pip install something
Answer #7:
This is a known Bug when there is a space in the virtualenv
path. Correction has been made, and will be available in the next version.
Answer #8:
i had same issue and did a pip upgrade using following and now it works fine.
python -m pip install --upgrade pip