-
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
_NamespacePath object has no attribute sort, again #4935
Comments
Hi @hagenw! Could you provide the complete output of the run causing the crash with |
I repeated it with your proposed modification: virtualenv --python=python3 --no-site-packages tmp
source tmp/bin/activate
pip install git+https://github.com/pypa/pip.git@master
pip install --verbose git+https://github.com/hagenw/sphinxcontrib-katex@math_numfig \
> pip-error.log The content of If I do the installation manually with git clone https://github.com/hagenw/sphinxcontrib-katex
cd sphinxcontrib-katex
virtualenv --python=python3 --no-site-packages tmp
source tmp/bin/activate
pip install git+https://github.com/pypa/pip.git@master
python setup.py install it works without any error. |
@hagenw it seems that your setuptools version is not new. Could you try upgrading setuptools and running the same command? |
Hi, I am having a similar issue. I get the error even when I run I have tried updating and upgrading |
@pradyunsg: I repeated my commands and checked that I have the latest setuptools installed: pip show setuptools
Name: setuptools
Version: 38.5.1 I'm getting exactly the same error as posted above. |
Fixing the error "_NamespacePath object has no attribute sort", cited in pypa#4935, by transforming the object NameSpace into a list to permit sorting by `position_in_sys_path`.
Is it correct to close this bug before the patch is made in pypi/pip? The above mentioned commit is to the CarlosDutra/pip fork, but it has not been pulled into pypi/pip yet. (And when I did "pip3 --upgrade pip" today, the manual patch I had made disappeared, causing the bug to return.) |
Ah, I see at #5103 that it was the pull request that was closed. It would be great if pip would require a setuptools version high enough (>= 39.0.1?) that this problem would stay fixed on an upgrade. |
Does this mean the bug should be fixed by using version 39.0.1 of setuptools? For me this is not the case. I repeated the commands from my earlier comment and still get the _NamespacePath sort method error with pip master (0007825) and setuptools 39.0.1. Those commands were:
|
tl;dr: Yes, at least it works for me. |
@hagenw Looking at the Gist again, I see that the traceback is coming from setuptools but I can't tell the version. Could you update it? If you're still having failures with newest setuptools and pip, could you post a new gist or update the previous one with the output with the newest versions of pip and setuptools? |
I added another file to the gist containing the error message: pip-error2.log. I used pip 10.0.0.dev0 and setuptools 39.0.1 as reported by
The old error message is also still available for comparison. |
Is the setuptools inside the repo of the right version? I see that 39.0.1 doesn't have the same line contents as the traceback suggests. |
Is there a way to test this? I made sure that |
@jaraco might have inputs here. I'm not entirely sure what is happening here. |
@hagenw if you find the time, what's the (complete) output of the following: Click to expand
|
I executed the commands and pasted the output with |
First, a summary. The issue in setuptools was corrected (more of a workaround) in 31.0.1. So if you're encountering the traceback, you should investigate where that older version of setuptools originated. If 'pip/_vendor' is in the traceback for pkg_resources, then it's pip's vendored version that is implicated.
That is surprising and unexpected output. I'll see if I can replicate the issue. |
I created this Dockerfile to attempt to replicate the issue:
I was unsuccessful. The docker build completed without error. @hagenw: Perhaps you have a virtualenv that's somehow pulling in an older setuptools? What do you get for |
From a bit of digging, it appears to me that pip 10.0 has setuptools > 31.0.1 (master was updated to 34.3.2 on Mar 18 2017). Releases in the 9.0.x series have pkg_resources from before then. Specifically, the commit mentioned in the OP's report (094afef) has a sufficiently new version of setuptools. FWIW, the OP is running on Ubuntu, and their unbundling of pip's vendored dependencies may be involved here (although the issue is reported against what appears to be an unmodified copy of pip from master, so I don't see how). |
@jaraco: I tested your docker file and it also builds without error on my machine.
I can also reproduce the error by using |
@hagenw I also am able to replicate the issue if I use
And this one employs the fix:
|
Cool, I can also fix it with Interestingly, this can fix the bug for
|
Re-installing Python worked for me! :) |
This error was a bug in an older version of setuptools which pip had vendored. Upgrading to an newer version of pip and setuptools should resolve this issue. Closing since I don't think there's anything actionable here from pip's end. |
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. |
Description:
The bug described in #4216 still happens for me with the latest master version (094afef) of pip.
What I've run:
The text was updated successfully, but these errors were encountered: