pip: pip fails to install projects with console entry points on Python 3.6
- Pip version: 8.1.2
- Python version: 3.6b0
- Operating System: Windows 7
>py -m pip --version
pip 8.1.2 from C:\Users\UK03306\AppData\Local\Programs\Python\Python36\lib\site-packages (python 3.6)
Description:
This appears to happen for any package with console entry points, but not for packages without. It looks like a distlib bug, so it will need fixing there and revendoring.
Further note, this issue seems to affect python -m pip install -U pip
so we’ll need to consider how to help users to upgrade past this issue. (Simplest way may be to recommend that users uninstall pip and then use get-pip.py
).
What I’ve run:
>py -m pip install invoke
Collecting invoke
Using cached invoke-0.13.0-py3-none-any.whl
Installing collected packages: invoke
Exception:
Traceback (most recent call last):
File "C:\Users\UK03306\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\UK03306\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\commands\install.py", line 317, in run
prefix=options.prefix_path,
File "C:\Users\UK03306\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_set.py", line 742, in install
**kwargs
File "C:\Users\UK03306\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Users\UK03306\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "C:\Users\UK03306\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\wheel.py", line 493, in move_wheel_files
maker.make_multiple(['%s = %s' % kv for kv in console.items()])
File "C:\Users\UK03306\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 383, in make_multiple
filenames.extend(self.make(specification, options))
File "C:\Users\UK03306\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\UK03306\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\UK03306\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 212, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\UK03306\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 351, in _get_launcher
result = finder(distlib_package).find(name).bytes
File "C:\Users\UK03306\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\resources.py", line 324, in finder
raise DistlibException('Unable to locate finder for %r' % package)
pip._vendor.distlib.DistlibException: Unable to locate finder for 'pip._vendor.distlib'
Presumably this is distlib issue https://bitbucket.org/pypa/distlib/issues/87/resource-finder-looking-at-wrong-module - is that correct @zooba?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 29 (22 by maintainers)
Commits related to this issue
- Temporary fix for pypa/pip#3964 — committed to PCManticore/pip by PCManticore 8 years ago
@ghostsquad The bug was in pip prior to 9.0.1. Your virtual environment has pip 7.1.0, which includes the bug, and so it’s nothing to do with Python 3.6.
You should either recreate your virtual environment, or delete the pip installation from site-packages completely (I’ve found that
pip uninstall pip
doesn’t work reliably once you’ve failed to upgrade it) and use theget-pip.py
script to install it again.As above, but fixed by running
easy_install pip
after removing all traces of pip from my venv.I quickly created a bash script to generate patched venvs on Windows using the information from above. Hope this helps someone generate their venvs a little bit faster!
I chucked it in a Gist
Code inline here:
Written in 5 mins, so feel free to improve
Same problem here on Windows 10: fresh Python 3.6 install, fresh venv.
Fixed by deleting all pip related directories under
C:\Users\Myuser\venv-3.6\Lib\site-packages\
, downloading get-pip.py and executing the command, as mentioned above by @zooba .@brettcannon Yeah, we didn’t get the newer version into b3, and the error comes from the installed version, not the one being installed. (However, uninstall followed by get-pip.py should be fine now, I’d imagine.)
We’ll need @vsajip to release a new version of distlib, which we can then vendor. I’m happy to do the re-vendor but I can’t produce a pip release. @dstufft would we be able to do a quick pip release for this?
Without an easy way to disable scripts, allowing an upgrade, maybe this would be worth a fixed Python 3.6b1 Windows binary with the updated pip in it? Unfortunately, that wouldn’t just be the distlib fix, so it may not be a good idea to have pip different in the Linux and Windows builds.