• Register
1 vote
109 views

Problem:

I am new in programming language. I was trying to setup and then upgrade gcloud using python.I used the command line in my windows command prompt.

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\

Why this is not installing and giving error? Please help me to solve this problem.

10 7 2
6,060 points

Please log in or register to answer this question.

1 Answer

1 vote
 
Best answer

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

If it is not working for you let me know.

Happy coding. 

11 6 4
34,950 points

Related questions

0 votes
1 answer 620 views
620 views
Problem: I am working on the sort function but while doing a small problem I am getting a error can you please what I am doing wrong,Program that takes a list of student name and sorts them to create a class roll number. The list of names will be given on line separated by ... item.sort(lambda x, y: cmp(x.lower(),y.lower())) print(item) AttributeError: 'str' object has no attribute 'sort'" Error"
asked Jun 9, 2020 Gavin 15.3k points
0 votes
1 answer 10 views
10 views
Problem: The code is the following (I am new to Python/Mysql): import mysql.connector conn = mysql.connector.connect(host='localhost',user='user1',password='puser1',db='mm') cursor = conn.cursor() string1 = 'test1' insert_query = """INSERT INTO items_basic_info (item_name) VALUES (%s)""", (string1) cursor.execute(insert_query) conn.commit() When I run this code I get this error:
asked 5 days ago Mashhoodch 9.1k points
0 votes
1 answer 23 views
23 views
Problem: I have a small problem with list. So i have a list called l: l = ['Facebook;Google+;MySpace', 'Apple;Android'] And as you can see I have only 2 strings in my list. I want to separate my list l by ';' and put my new 5 strings into a new list called ... tried to do this like this: l1 = l.strip().split(';') But Python give me an error: AttributeError: 'list' object has no attribute 'strip'
asked Feb 13 Mashhoodch 9.1k points
0 votes
1 answer 11 views
11 views
Problem: From Python: Attribute Error - 'NoneType' object has no attribute 'something': NoneType what means that instead of an instance of whatever Class or Object you think you're working with? you've actually got None. what That usually means that an assignment or function call up above failed or returned an unexpected result?
asked Jan 27 Mashhoodch 9.1k points
0 votes
1 answer 21 views
21 views
Problem: The CSV file contains 37 attributes + the label (last column). it doesn't contain header or index. Exp of the 1st row: 63651000000.0,63651000000.0,153.1,0,0,0,0,0,0,5,1,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ... "csv2libsvm.py", line 47, in <module> headers = reader.next() AttributeError: '_csv.reader' object has no attribute 'next' Do you have any idea about the problem ?
asked Jan 9 Mashhoodch 9.1k points
0 votes
1 answer 435 views
435 views
When trying to find the index of v but it gave me: 'numpy.ndarray' object has no attribute 'index' none of them have answered my question v = np.random.randn(10) print(v) maximum = np.max(v) minimum = np.min(v) print(maximum, minimum) v.index(maximum, minimum)
asked Oct 30, 2020 psandprop 2.4k points
0 votes
1 answer 107 views
107 views
Why does this code give AttributeError? internship = parser.find_all('a', attrs = {'title': lambda job: job.startswith('Internship')}) while this one works: internship = parser.find_all('a', attrs = {'title': lambda job: job and job.startswith('Internship') ... , in _matches return match_against(markup) File "<stdin>", line 1, in <lambda> AttributeError: 'NoneType' object has no attribute 'start
asked Oct 30, 2020 psandprop 2.4k points
0 votes
1 answer 310 views
310 views
Python 3.3.2 import json & urllib.request Json [{"link":"","orderid":"100000222"}, {"link":"","orderid":"100000222"}, {"link":"","orderid":"100000222"}] print(response.info()) Date: Sun, 20 Oct 2013 07:06:51 GMT Server: Apache X-Powered-By: PHP/5.4.12 Content ... line 271, in load return loads(fp.read(), AttributeError: 'str' object has no attribute 'read' >>> . Any idea how i can fix this issue?
asked Oct 25, 2020 psandprop 2.4k points
0 votes
0 answers 159 views
159 views
function anagrams(s1, s2) is a Boolean valued function, which returns true just in case the string s1 contains the same letters as string s2 but in a different order. The function should be case insensitive --- in other words it should return the same value if any letters in either s1 or ... ; Ayxan Haqverdili Nov 12 '18 at 15:43 I've no idea..... maybe my logic is wrong, the output is so wired...
asked Oct 25, 2020 psandprop 2.4k points
0 votes
1 answer 158 views
158 views
This line: sift = cv2.xfeatures2d.SIFT_create() return error: Traceback (most recent call last): File "C:/Python27/openCVskrypty/GUI/SOLUTION2.py", line 11, in <module> sift = cv2.xfeatures2d.SIFT_create() AttributeError: 'module' object has no attribute 'xfeatures2d' I ... ) and I haven't got xfeatures2d module. Does anyone know why? Can I download it separately? Thanks for help how fix this.
asked Oct 24, 2020 psandprop 2.4k points