Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run pip v. 10.0.0 with python 3.6.5 on Win 7 64 #5223

Closed
lbauchi opened this issue Apr 14, 2018 · 34 comments
Closed

Unable to run pip v. 10.0.0 with python 3.6.5 on Win 7 64 #5223

lbauchi opened this issue Apr 14, 2018 · 34 comments
Labels
auto-locked Outdated issues that have been locked by automation project: vendored dependency Related to a vendored dependency type: bug A confirmed bug or unintended behavior
Milestone

Comments

@lbauchi
Copy link

lbauchi commented Apr 14, 2018

  • 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

@SunsetOrange
Copy link

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.

@pradyunsg
Copy link
Member

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?

@UserNotExist12
Copy link

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"

@pfmoore
Copy link
Member

pfmoore commented Apr 15, 2018

@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.

@fbprod
Copy link

fbprod commented Apr 15, 2018

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

@pfmoore
Copy link
Member

pfmoore commented Apr 15, 2018

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)

@pfmoore
Copy link
Member

pfmoore commented Apr 15, 2018

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.

@pfmoore
Copy link
Member

pfmoore commented Apr 15, 2018

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.

@shimizukawa
Copy link
Contributor

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.

@dstufft
Copy link
Member

dstufft commented Apr 15, 2018

If needed we can downgrade our distlib too.

@pradyunsg pradyunsg added type: bug A confirmed bug or unintended behavior project: vendored dependency Related to a vendored dependency labels Apr 15, 2018
@pradyunsg pradyunsg added this to the 10.0.1 milestone Apr 15, 2018
@pfmoore
Copy link
Member

pfmoore commented Apr 15, 2018

@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.

@pradyunsg
Copy link
Member

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. :(

@pfmoore
Copy link
Member

pfmoore commented Apr 15, 2018

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.

@arjunkharbanda
Copy link

Same issue here

@GerhardDeuter
Copy link

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

@vsajip
Copy link
Contributor

vsajip commented Apr 16, 2018

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.

@pfmoore
Copy link
Member

pfmoore commented Apr 16, 2018

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.

@pfmoore pfmoore added the !release blocker Hold a release until this is resolved label Apr 16, 2018
@pfmoore pfmoore mentioned this issue Apr 16, 2018
@shimizukawa
Copy link
Contributor

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

🎉

@arjunkharbanda
Copy link

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

@arjunkharbanda
Copy link

arjunkharbanda commented Apr 16, 2018

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.

@pradyunsg
Copy link
Member

Could you file a new issue for that?

Do mention what PATH is, in that issue.

@vsajip
Copy link
Contributor

vsajip commented Apr 17, 2018

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

@pradyunsg
Copy link
Member

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

@arjunkharbanda
Copy link

arjunkharbanda commented Apr 18, 2018

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

@pfmoore
Copy link
Member

pfmoore commented Apr 18, 2018

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

@pfmoore
Copy link
Member

pfmoore commented Apr 18, 2018

Closing as #5257 is now in master.

@Kobra299
Copy link

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

@MHHenriksen
Copy link

@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.

@AndrewUshakov
Copy link

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:

src\pip_vendor\distlib\t32.exe
src\pip_vendor\distlib\t64.exe

and in the pip.exe itself.

  1. After

python -m pip uninstall pip
easy_install.exe pip

error disappeared.

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

@pfmoore
Copy link
Member

pfmoore commented Apr 19, 2018

@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).

mtreinish added a commit to mtreinish/stestr that referenced this issue Apr 27, 2018
Running pip>=10.0.0 in the windows ci is failing and blocking changes.
This commit is to workaround this issue, #165, until the upstream
pypa/pip#5223 (or equivalent bug) is fixed in another pip release by
capping pip to be <10.0.0.
mtreinish added a commit to mtreinish/stestr that referenced this issue Apr 27, 2018
Running pip>=10.0.0 in the windows ci is failing and blocking changes.
This commit is to workaround this issue, #165, until the upstream
pypa/pip#5223 (or equivalent bug) is fixed in another pip release by
capping pip to be <10.0.0.
jbarlow83 pushed a commit to pikepdf/pikepdf that referenced this issue May 21, 2018
jbarlow83 added a commit to jbarlow83/python_example that referenced this issue May 21, 2018
See pypa/pip#5223 - there is a pip 9 to 10 upgrade issue that prevents a direct `pip install ... --upgrade pip` from working.

While the issue is closed in pip upstream, it still seems to cause problems.
@ghost
Copy link

ghost commented Aug 20, 2018

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

@p0lm
Copy link

p0lm commented Mar 25, 2019

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.

@Droidzzzio
Copy link

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\Scripts\pip.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

@lock
Copy link

lock bot commented May 28, 2019

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.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation project: vendored dependency Related to a vendored dependency type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests