-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
AttributeError: '_NamespacePath' object has no attribute 'sort' #2990
Comments
@Rockyyost This error is 100% in |
I'm pre-emptively closing but happy to re-open if more information arises. |
Notably, you just need to update your pip & setuptools.
…On Wed, Feb 8, 2017, 8:55 PM Danny Hermes ***@***.***> wrote:
I'm pre-emptively closing but happy to re-open if more information arises.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2990 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPUc4exjr5-VpkrvSjWyZD0XQGw51ioks5rapwqgaJpZM4L7sYe>
.
|
Not sure if this is related pypa/setuptools#885 (comment). |
I am re-opening; I think this might actually be an issue with the current version of pip (as in, pip re-broke it), and I want to track it. |
|
Is there a workaround for this? I can't install Edit: |
@naveg Thanks for updating with the workaround you found! |
Yeah, my problem turned out to be unrelated and I forgot about this ticket. Re-closing. |
Workaround / Fix
With |
@MarSoft bit tricky in a chicken-egg kind of way: # pip install --upgrade pip setuptools
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 7, in <module>
from pip import main
File "/usr/local/lib/python3.5/dist-packages/pip/__init__.py", line 26, in <module>
from pip.utils import get_installed_distributions, get_prog
File "/usr/local/lib/python3.5/dist-packages/pip/utils/__init__.py", line 27, in <module>
from pip._vendor import pkg_resources
File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 3018, in <module>
@_call_aside
File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 3004, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 3046, in _initialize_master_working_set
dist.activate(replace=False)
File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 2578, in activate
declare_namespace(pkg)
File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 2152, in declare_namespace
_handle_ns(packageName, path_item)
File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 2092, in _handle_ns
_rebuild_mod_path(path, packageName, module)
File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 2121, in _rebuild_mod_path
orig_path.sort(key=position_in_sys_path)
AttributeError: '_NamespacePath' object has no attribute 'sort' |
Looks highly related to pypa/pip#4216. |
@bkleef Indeed these are the same issue. The fix is a simple one: update |
@dhermes indeed but 9.0.2 is not yet on pypa and so you need to upgrade like:
|
I don't think the issue is present in the latest released version of |
we are facing the same issue on latest anaconda (and python 3.6.1) - we did the same thing as @bkleef and got it working (pip install) |
@jonparrott Was there some |
It's been around a while. You might have to update setuptools separately from other packages and/or in a different order depending on what versions are currently installed.
|
I can't even upgrade pip as the same error shows when trying |
@sree-kumar Check out |
For all those coming by, I have done a "deep" dive today to understand this issue and found out that This If you have a fresh environment and only use Sorry for the inconvenience. References: |
@dhermes I ended up here after going round the houses, though even with a "fresh" environment, and using
The only way I have been able to get around it is to comment out the offending line in Im still reading through to see what effect this will have, though im not going to be able to do that on my PAAS (flexible environment in appengine) |
UPDATE, mines working with pip from bleeding edge, no steuptools upgrade (thanks @bkleef ):
|
Please ignore this question, that is from a different issue other than my local env. |
that can't sovle |
its been almost 2 years and still nobody could find a solution for this. I tried everything that are mentioned here but no luck. I will give up on python adventually. |
I found a workaround: |
For me setuptools-41.0.1 was giving the error. Downgrading it to 39.1.0 as mentioned solved the issue for python 3.6.7 |
Faced same issue while building Tensorflow=1.14.1 under virtualenv. @oldmonkABA solution worked for me. Changed setuptools verion from 41 to 39.1 |
don't try to giving up |
|
|
Thank you so much. Finally worked for me after trying soooo many unsuccessful options. Thanks @bkleef |
hello everyone, I had these specifications When I run: And But when I run
I went to change the init.py like the instruction above but It didn't work. If there is any help, I would appreciate it. |
degrade setuptool just as @bikramkhastgir said |
thank god for it |
on certain distros, buggy pip and setuptools are used, so we need to upgrade them first. see also: googleapis/google-cloud-python#2990 and pypa/setuptools#885 Signed-off-by: Kefu Chai <[email protected]>
on certain distros, buggy pip and setuptools are used, so we need to upgrade them first. see also: googleapis/google-cloud-python#2990 and pypa/setuptools#885 Signed-off-by: Kefu Chai <[email protected]>
how to fix : Command "python setup.py egg_info" failed with error codeUbuntu: use apt problem should not occur on centos 8, or versions later than Ubuntu 18. This should allow python3 to fix your pip2 setup tools: Ubuntu:
Centos 7:
If for some reason it's still broken (because not only are there different flavors, each cloud has their own flavor of a flavor):
____ don't try anything yet, read on past yum____
after the installation, most will have this error: WARNING: The scripts PIP_X are installed in '/usr/local/bin' which is not on PATH, and if you try to:
sudo nano /etc/environment make sure this is added (also, if you don't have a fresh install, I will not know where else your installations are, so if you have any other paths, add them to the list by adding a
FINAL STEPS:
It should now say (as of writing this) AND NOW: remove the broken package reinstall your package and export FOR FUTURE UPDATES, CHECK THE VERSION PYTHON IS USING, SOMEDAY IT WILL BE 4. |
I was trying install with pip install --upgrade google-cloud but I get the following AttributeError: '_NamespacePath' object has no attribute 'sort'
Below is the stack trace:
The text was updated successfully, but these errors were encountered: