• Register
2 votes
68 views

Problem:

I am new in programming language. I was trying to setup and then upgrade gcloud using python.
I used the command:
pip install --upgrade gcloud

After that it shows:

Collecting gcloud
  Downloading gcloud-0.18.3.tar.gz (454kB)
    100% |████████████████████████████████| 460kB 1.0MB/s
Requirement already up-to-date: httplib2>=0.9.1 in c:\users\bid\appdata\local\programs\python\python36-32\lib\site-packages (from gcloud)
Collecting googleapis-common-protos (from gcloud)
  Using cached googleapis-common-protos-1.5.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\bid\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\__init__.py", line 10, in <module>
        from setuptools.extern.six.moves import filter, filterfalse, map
      File "c:\users\bid\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\extern\__init__.py", line 1, in <module>
        from pkg_resources.extern import VendorImporter
      File "c:\users\bid\appdata\local\programs\python\python36-32\lib\site-packages\pkg_resources\__init__.py", line 3017, in <module>
        @_call_aside
      File "c:\users\bid\appdata\local\programs\python\python36-32\lib\site-packages\pkg_resources\__init__.py", line 3003, in _call_aside
        f(*args, **kwargs)
      File "c:\users\bid\appdata\local\programs\python\python36-32\lib\site-packages\pkg_resources\__init__.py", line 3045, in _initialize_master_working_set
        dist.activate(replace=False)
      File "c:\users\bid\appdata\local\programs\python\python36-32\lib\site-packages\pkg_resources\__init__.py", line 2577, in activate
        declare_namespace(pkg)
      File "c:\users\bid\appdata\local\programs\python\python36-32\lib\site-packages\pkg_resources\__init__.py", line 2151, in declare_namespace
        _handle_ns(packageName, path_item)
      File "c:\users\bid\appdata\local\programs\python\python36-32\lib\site-packages\pkg_resources\__init__.py", line 2091, in _handle_ns
        _rebuild_mod_path(path, packageName, module)
      File "c:\users\bid\appdata\local\programs\python\python36-32\lib\site-packages\pkg_resources\__init__.py", line 2120, in _rebuild_mod_path
        orig_path.sort(key=position_in_sys_path)

And then a error message:

 AttributeError: '_NamespacePath' object has no attribute 'sort'
   
Command "python setup.py egg_info" failed with error code 1 in C:\Users\bid\AppData\Local\Temp\pip-build-ppc44asr\googleapis-common-protos\

Whats is happening here can anyone help?

6.1k points

Please log in or register to answer this question.

1 Answer

0 votes

Answer:

The error you are having becuse your setuptools may be out of date.

Try to upgrade your setuptools and please use your setup tools for your specific versions of python.

To upgrade your setuptools run the command:

pip install --upgrade setuptools

Let me know if it is working for you.

35k points