Pip: Unable to run pip v. 10.0.0 with python 3.6.5 on Win 7 64

Created on 14 Apr 2018  ยท  34Comments  ยท  Source: pypa/pip

  • Pip version: 10.0.0
  • Python version: 3.6.5
  • Operating system: Win 7 64

Description:

Upgrading from version 9.0.3 causes pip not to work anymore with the error message:

Fatal error in launcher: Unable to create process using '""c:\program files\python36\python.exe" "C:\Program Files\Python36\Scripts\pip.exe"

The same happens with pip3.exe or pip36.exe (of course, they are identical, but using them could help to solve path conflicts).

The only way to solve the problem was to rollback to version 9.0.3. (I also tried version 9.0.1 just as a distraction :-), and it worked too ).
Of course, I tried a plethora of solutions to be able to keep version 10.0.0, then I gave up and rolled back to version 9.0.3

What I've run:

From PowerShell or DOS window:

< python -m pip install -U pip > to upgrade pip to 10.0.0. Everything went well.

< python -m pip install pip==9.0.3 > to rollback

vendored dependency auto-locked bug

Most helpful comment

To revert pip version, I did following:

> python -m pip uninstall pip
> python -m ensurepip
> python -m pip install -U "pip<10"

and uninstall+install all other affected packages.

All 34 comments

I'm also having the exact same issue since upgrading to pip 10. Happens whenever I try to install a package the old way (eg. pip install pylint). It will only work if I append "python -m" to the front of the command. Confirmed this on Python 3.7, and I am pretty sure it was happening with 3.6.5 as well.

This _might_ be because of the script not updating. Does uninstalling pip and then reinstalling with get-pip.py improve the situation?

Note that you'd have to rename get-pip.py to not contain the word "pip" for it to work currently. (would be fixed in #5233)

@pfmoore do you have any inputs on this?

There is an extra quatation mark in the command, that caused this issue.
the wrong command
""c:\program files\python36\python.exe" "C:\Program Files\Python36\Scripts\pip.exe"
the right command, see the difference.
"c:\program files\python36\python.exe" "C:\Program Files\Python36\Scripts\pip.exe"

@UserNotExist12 Well spotted, yes that would likely cause the problem. However, I've no idea why that extra quote would be appearing, or even what it's appearing in. @lbauchi can you provide a better example of how to reproduce this? "Upgrading from version 9.0.3" isn't that specific - it's worked when I've done it...

One question, did you upgrade using "python -m pip install --upgrade pip" or "pip install --upgrade pip"? The latter is wrong (and this is noted in the docs) and will result in the 9.0.3 pip.exe script wrapper not being upgraded. There would have been an error if you'd done that. But even so, I have to say that I don't know why that would result in the effects you're seeing.

I upgraded pip using python -m pip install --upgrade pip and I have the same problem.

Error message:

Fatal error in launcher: Unable to create process using '""c:\program files\python36\python.exe" "C:\Program Files\Python36\Scripts\pip.exe"' with double quotation mark.

  • Pip version: 10.0.0 / 9.0.3
  • Python version: 3.6.5 64

    • Operating system: Win 10 64

Thanks. I do not get the same behaviour (Windows 10 64-bit, Python 3.6.2 64-bit):

PS>python -m pip --version
pip 9.0.3 from C:\Users\Gustav\.virtualenvs\5ba9a2da89fcba2\lib\site-packages (python 3.6)
PS>python -m pip install --upgrade pip
Collecting pip
  Using cached pip-10.0.0-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 9.0.3
    Uninstalling pip-9.0.3:
      Successfully uninstalled pip-9.0.3
Successfully installed pip-10.0.0
PS>pip --version
pip 10.0.0 from c:\users\gustav\.virtualenvs\5ba9a2da89fcba2\lib\site-packages\pip (python 3.6)

OK. It appears to be because of the space in your path (C:\Program Files\Python36\Scripts\pip.exe). I have reproduced this using a virtualenv with a space in the pathname.

This appears to be a distlib bug. I've reported it, with a test case, at https://bitbucket.org/pypa/distlib/issues/104/generated-wrapper-scripts-fail-when-python

We'll need to wait for a fix from distlib and then re-vendor. I don't see an obvious way we can work around this in pip, unfortunately.

To revert pip version, I did following:

> python -m pip uninstall pip
> python -m ensurepip
> python -m pip install -U "pip<10"

and uninstall+install all other affected packages.

If needed we can downgrade our distlib too.

@dstufft agreed, I want to give @vsajip time to look at the issue, but if he can't cut a release that fixes this in time, that's what I plan on doing. I have a feeling it reverts some other fixes that we'd like to get, though so it's definitely not the preferred option.

I have a feeling it reverts some other fixes that we'd like to get, though so it's definitely not the preferred option.

From #4819, it seems #923 would get un-fixed. :(

That's a bit worrying, as it implies that reverting might not fix this issue either :-(

If I get some time, I'll try dropping the previous version of distlib into a pip installation and see if this problem still occurs. If it does, we may have to wait for a fix from distlib :-(

BTW, we should add a test for running pip from a directory with spaces on it. Appveyor's setup doesn't use spaces, nor does my normal setup (I use a standard "per user" installation). But the CPython "All users" installation goes to "Program Files" - so it will be a common scenario and we need to test for it.

Same issue here

Same issue here, downgraded again to 9.0.3.
Pip version: 10.0.0 / 9.0.3
Python version: 3.6.3 64
Operating system: Win 10 64

distlib updated in the repo with a change which should fix this. Please verify the repo version fixes things, then I will cut a distlib version you can use to re-vendor in pip.

To help users to test this fix, I've created a branch distlib_fix in my clone of the pip repo https://github.com/pfmoore/pip. I tested the fix as follows:

>py -m venv "a b"
>& '.\a b\Scripts\python.exe' -m pip install --upgrade 'git+https://github.com/pfmoore/pip@distlib_fix#egg=pip'
Collecting pip from git+https://github.com/pfmoore/pip@distlib_fix#egg=pip
  Cloning https://github.com/pfmoore/pip (to distlib_fix) to c:\users\uk03306\appdata\local\temp\pip-build-8iltcg7r\pip
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
  Running setup.py install for pip ... done
Successfully installed pip-10.0.0
>& '.\a b\Scripts\pip.exe' --version
pip 10.0.0 from C:\Work\Scratch\a b\lib\site-packages\pip (python 3.6)

At least in my test, I can confirm that the fix is working.

distlib_fix works fine.

[ๅฎŸ้จ“ D] > pwd
Path
----
C:\Users\taka\ๅฎŸ้จ“ D
[ๅฎŸ้จ“ D] > python -m virtualenv virtualenv-pip10-pfmoore
Using base prefix 'C:\\Users\\taka\\AppData\\Local\\Programs\\Python\\Python36-32'
New python executable in C:\Users\taka\ๅฎŸ้จ“D~1\VI5F03~1\Scripts\python.exe
Installing setuptools, pip, wheel...done.
[ๅฎŸ้จ“ D] > .\virtualenv-pip10-pfmoore\Scripts\pip.exe -V
pip 10.0.0 from c:\users\taka\ๅฎŸ้จ“d~1\vi5f03~1\lib\site-packages\pip (python 3.6)
[ๅฎŸ้จ“ D] > .\virtualenv-pip10-pfmoore\Scripts\python.exe -m pip install -U https://github.com/pfmoor
e/pip/archive/distlib_fix.zip
Collecting https://github.com/pfmoore/pip/archive/distlib_fix.zip
  Downloading https://github.com/pfmoore/pip/archive/distlib_fix.zip (6.4MB)
    100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 6.4MB 1.1MB/s
  Installing build dependencies ... done
Building wheels for collected packages: pip
  Running setup.py bdist_wheel for pip ... done
  Stored in directory: C:\Users\taka\AppData\Local\Temp\pip-ephem-wheel-cache-gqsmkvtc\wheels\30\d4\19\3c45d45ab7d333f327892822f08f418d363b27b831b43ef815
Successfully built pip
Installing collected packages: pip
  Found existing installation: pip 10.0.0
    Uninstalling pip-10.0.0:
      Successfully uninstalled pip-10.0.0
Successfully installed pip-10.0.0
[ๅฎŸ้จ“ D] > .\virtualenv-pip10-pfmoore\Scripts\pip.exe -V
pip 10.0.0 from c:\users\taka\ๅฎŸ้จ“ d\virtualenv-pip10-pfmoore\lib\site-packages\pip (python 3.6)
[ๅฎŸ้จ“ D] > .\virtualenv-pip10-pfmoore\Scripts\pip.exe uninstall wheel -y
Uninstalling wheel-0.31.0:
  Successfully uninstalled wheel-0.31.0
[ๅฎŸ้จ“ D] > .\virtualenv-pip10-pfmoore\Scripts\pip.exe install wheel
Collecting wheel
  Using cached https://files.pythonhosted.org/packages/1b/d2/22cde5ea9af055f81814f9f2545f5ed8a053eb749c08d186b369959189a8/wheel-0.31.0-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.31.0
[ๅฎŸ้จ“ D] > .\virtualenv-pip10-pfmoore\Scripts\wheel.exe -V
usage: wheel [-h]
             {keygen,sign,unsign,verify,unpack,install,install-scripts,convert,version,help}
             ...
wheel: error: unrecognized arguments: -V
[ๅฎŸ้จ“ D] > .\virtualenv-pip10-pfmoore\Scripts\python.exe -c "from pip._vendor import distlib; print(
distlib.__version__)"
0.2.7.dev0

๐ŸŽ‰

looks like distlib_fix fixes the pip issue as I am just a beginner in Python/Django I cannot test the advance things

now this warning pops up when I install something and yes PATH is already added to the environment variables

The script django-admin.exe is installed in 'C:\Users\Arjun Kharbanda\AppData\Local\Programs\Python\Python36\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Could you file a new issue for that?

Do mention what PATH is, in that issue.

distlib 0.2.7 has been released - re-vendoring with it should resolve this issue (the OP).

@vsajip Yep. We have #5257 already. :)

is the issue fixed now? if yes can someone guide me how to fix this on my end?

@arjunkharbanda The fix is in master and will be released as 10.0.1 in the next couple of days.

Closing as #5257 is now in master.

how do you fix this on Windows 7 as it happens when I upgraded to pip 10 I have since reverted back to 9.0.3 until the version of 10 can be fixed

@Kobra299, quoting from two comments earlier:

The fix is in master and will be released as 10.0.1 in the next couple of days.

Sorry, did not find this issue and created duplicate.

So I would like to copy here my comments:

1) Command python -m pip works as expected.

2) I found text "Fatal error in launcher" only in executables:

srcpip_vendordistlib\t32.exe
srcpip_vendordistlib\t64.exe

and in the pip.exe itself.

3) After

python -m pip uninstall pip
easy_install.exe pip

error disappeared.

4) It is interesting, that initially pip.exe had almost the same size as t64.exe, now it significantly shorter.

@AndrewUshakov The wrapper script used by easy_install is very different from the one used by pip, so you'll have to be careful if you want to use pip to upgrade itself later. But that's why the size is different. (There may be other differences from having installed pip via easy_install, I'm not an expert in easy_install so I can't really comment).

ok i was having the same problem and this is what i did, just in case anyone needs help aka beginners
Goto The pip.exe folder
delete it
delete python launcher and python interperter
reinstall the python interpreter
if this has been listed oh well but heres an easy guide

This problem occurs for me with Python 3.7.2 on Windows 10. The pip.exe has a hardcoded path to "c:\program files\python37\python.exe" which does not exist, as the Python executable is installed by default in %LOCALAPPDATA%\Programs\Python\Python37\python.exe. Using python -m pip works as a workaround, but pipenv is still broken.

facing same error with python3.7.0 , fatal error at pip
Fatal error in launcher: Unable to create process using '"c:\program files\python37\python.exe" "C:\Program Files\Python37\Scriptspip.exe" '

installed python3 in C:\Programs files\Python37

Also one installation is present in C:\Users\User\appdata\roaming\python37
Please i am confused help me

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JordanReiter picture JordanReiter  ยท  3Comments

reynoldsnlp picture reynoldsnlp  ยท  3Comments

imzi picture imzi  ยท  3Comments

dmfigol picture dmfigol  ยท  3Comments

dstufft picture dstufft  ยท  3Comments