-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip fails to install projects with console entry points on Python 3.6 #3964
Comments
Just to be clear, assuming this is a distlib issue, there's no immediate action needed for pip. I raised this issue mainly as a reminder that we need to get a fix out relatively quickly once the distlib issue is resolved, as the problem makes it particularly hard for users to test the new Python 3.6 release. |
Yep, that's the issue. I was just coming over here to link to it :) |
Do you know of any env var or CLI option to skip entry points? I couldn't find anything quickly scanning the docs and code |
Not offhand, unfortunately. |
Looks like Vinay just resolved the issue. It would be nice to get pip updated too. |
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. |
Hi. I get a " 'pip' has no attribute 'get installed distributions'" (on3.6.0b1-amd64 win10). is it same sort of issue or a new one ? found the/my error : my install process was doing a "python -m pip install --upgrade --force-reinstall pip" that ends badly when pip version is unchanged. Sorry for the noise ... patching resources.py doesn't seem to be enough tp resolve the issue, for Winpython at least, as I get now the same initial error as pfmoore. |
Guido unequivocally stated last week that quick fixes like that should up the version number, and I'm inclined to agree. I think uninstalling and running get-pip.py is not unreasonable. |
@stonebig I think your install is corrupt - have you tried repairing it? |
Python 3.6.0b1 (64-bit)_20160913185823.log.txt idle works, on the winpython3.6 beta directory, so things are not an absolute fail. |
@pfmoore Except I did just try |
@stonebig I think we need you to write up the step-by-step list of everything you did and post it on https://bugs.python.org/. I'm fairly convinced your issues are not bugs in CPython or pip, but they may be an installer issue. Without specific steps and the download URLs you used, I can't make any better guesses. |
@zooba |
https://bugs.python.org/issue28132 1- I did the zooba style of install of python3.6, to get a zippable thing, I'm windows10-10586.545 (not upgraded to summer 2016 yet) |
ok, by clicking on the ".exe" installer, I succeeded to repair, then via "application and functionalities menu" uninstall started the right way, finished happy of itself ... without uninstalling from "applications and functionalities". clicking again on the installer (instead of application and functionnalities) did at last the job of uninstalling |
Running into this issue :( |
I assume the fix is in the recently released distlib 0.2.4, so we should revendor. (Probably better if someone on Unix does this, IIRC git gets confused over line endings if I do it on Windows :-() |
Yes, it's in 0.2.4 (listed under "Resources" at https://goo.gl/M3kQzR) |
I just tried to update to pip 9.0.0 and I'm still seeing the error under Python 3.6.0b3: Collecting pip
Using cached pip-9.0.0-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.1.2
Uninstalling pip-8.1.2:
Successfully uninstalled pip-8.1.2
Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
File "C:\Users\brcan\Desktop\venv-py36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\brcan\Desktop\venv-py36\lib\site-packages\pip\commands\install.py", line 317, in run
prefix=options.prefix_path,
File "C:\Users\brcan\Desktop\venv-py36\lib\site-packages\pip\req\req_set.py", line 742, in install
**kwargs
File "C:\Users\brcan\Desktop\venv-py36\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\brcan\Desktop\venv-py36\lib\site-packages\pip\req\req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "C:\Users\brcan\Desktop\venv-py36\lib\site-packages\pip\wheel.py", line 463, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\Users\brcan\Desktop\venv-py36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\brcan\Desktop\venv-py36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\brcan\Desktop\venv-py36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 212, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\brcan\Desktop\venv-py36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 351, in _get_launcher
result = finder(distlib_package).find(name).bytes
File "C:\Users\brcan\Desktop\venv-py36\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' |
maybe you need to wait python-3.6.0b4, to have pip-9.0.1 bundled inside ? |
@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.) |
this appears to still be a problem for 3.6.0 for Windows (release date: 2016-12-23)
|
@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 |
@zooba Fresh install of Python 3.6, get-pip.py is encountering this error that was supposedly resolved in 3.5. Any advice? Right now I'm SOL for updating pip. EDIT - I was able to resolve this with the following steps:
try:
bootstrap(tmpdir=tmpdir)
finally:
... This forced get-pip.py to use the 8.1.2 instead of its internal pip binary which was running into the zlib error I indicated in my original comment. |
Same problem here on Windows 10: fresh Python 3.6 install, fresh venv.
Fixed by deleting all pip related directories under |
As above, but fixed by running |
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: #!/bin/bash
# This is a handy script to apply a pip fix to the venv created by python 3.6 on Windows
# Written by Mike Goodfellow in a few minutes - feel free to improve this!!
# Based on information in https://github.com/pypa/pip/issues/3964
#
# NOTE: Currently works if python on path points to python3 which is commonly
# does on Windows.
if [ $# -ne 1 ]
then
echo "Usage: venv_init /path/to/venv"
exit 1
fi
echo "Creating new venv in $1..."
# NOTE: This needs to be on the path...
python -m venv $1
echo "Applying the pip fix..."
rm -rf $1/Lib/site-packages/pip*
$1/Scripts/easy_install pip
$1/Scripts/pip install --upgrade pip setuptools
echo "Patched version of venv has been configured in $1" Written in 5 mins, so feel free to improve |
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 useget-pip.py
).What I've run:
Presumably this is distlib issue https://bitbucket.org/pypa/distlib/issues/87/resource-finder-looking-at-wrong-module - is that correct @zooba?
The text was updated successfully, but these errors were encountered: