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 ?
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 ?
For me this problem appeared when I changed the environment path to point to v2.7 which was initially pointing to v3.6. After that, to run pip or virtualenv commands, I had to
python -m pip install XXX
as mentioned in the answers below.So, in order to get rid of this, I ran the v2.7 installer again, chose change option and made sure that, add to path option was enabled, and let the installer run. After that everything works as it should.
I have chosen to install Python for Windows (64bit) not for all users, but just for me.
Reinstalling Python-x64 and checking the advanced option "for all users" solved the pip problem for me.
Please add this address :
in Windows PATH Variable
Though first make sure this is the folder where Python exe file resides, then only add this path to the PATH variable.
To append addresses in PATH variable, Please go to
Then append the above mentioned path & click Save
On Windows at least,
pip
stores the execution path in the executablepip.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:
to an escaped path without spaces and quotes and pad with spaces (dots at the end should be spaces):
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 topip
.I had a similar issue and upgrading pip fixed it for me.
This was on Windows and the path to python inside pip.exe was incorrect. See Archimedix answer for more information about the path.
On windows I solved this problem a little complex way :
1) Uninstalled Python
2) went to
C:\Users\MyName\AppData\Local\Programs
(your should turn on hidden files visibility Show hidden files instruction)3)deleted 'Python' folder
4) installed Python