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

Python 3.6: AttributeError: '_NamespacePath' object has no attribute 'sort' #16

Closed
andychase opened this issue Nov 21, 2017 · 1 comment

Comments

@andychase
Copy link

andychase commented Nov 21, 2017

Traceback (most recent call last):
  File "/usr/local/bin/pur", line 7, in <module>
    from pur.__init__ import pur
  File "/usr/local/lib/python3.6/site-packages/pur/__init__.py", line 24, in <module>
    from pip.download import PipSession
  File "/usr/local/lib/python3.6/site-packages/pur/packages/pip/__init__.py", line 26, in <module>
    from pip.utils import get_installed_distributions, get_prog
  File "/usr/local/lib/python3.6/site-packages/pur/packages/pip/utils/__init__.py", line 27, in <module>
    from pip._vendor import pkg_resources
  File "/usr/local/lib/python3.6/site-packages/pur/packages/pip/_vendor/pkg_resources/__init__.py", line 3017, in <module>
    @_call_aside
  File "/usr/local/lib/python3.6/site-packages/pur/packages/pip/_vendor/pkg_resources/__init__.py", line 3003, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pur/packages/pip/_vendor/pkg_resources/__init__.py", line 3045, in _initialize_master_working_set
    dist.activate(replace=False)
  File "/usr/local/lib/python3.6/site-packages/pur/packages/pip/_vendor/pkg_resources/__init__.py", line 2577, in activate
    declare_namespace(pkg)
  File "/usr/local/lib/python3.6/site-packages/pur/packages/pip/_vendor/pkg_resources/__init__.py", line 2151, in declare_namespace
    _handle_ns(packageName, path_item)
  File "/usr/local/lib/python3.6/site-packages/pur/packages/pip/_vendor/pkg_resources/__init__.py", line 2091, in _handle_ns
    _rebuild_mod_path(path, packageName, module)
  File "/usr/local/lib/python3.6/site-packages/pur/packages/pip/_vendor/pkg_resources/__init__.py", line 2120, in _rebuild_mod_path
    orig_path.sort(key=position_in_sys_path)
AttributeError: '_NamespacePath' object has no attribute 'sort'
@andychase
Copy link
Author

Installing from the bleeding edge as suggested here: googleapis/google-cloud-python#2990 (comment)

And then copying the pip directory into pur/packages/pip fixed the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant