bramwell2010
bramwell2010

Reputation: 175

Sheets API Python Error

I'm new to installing modules, etc, but believe I've done everything correctly and I'm getting errors. I'm following the instructions here: https://developers.google.com/gdata/articles/python_client_lib#library

Steps: 1. downloaded Zip of gdata here: https://github.com/google/gdata-python-client 2. unzipped and placed into my Scripts folder: C:\Python34\Scripts\gdata-python-client-master 3. went to cmd, above directory and installed: I did get a bunch of syntax errors (commas, etc), assuming this is why the next steps aren't working...
4. in python prompt, it says i have module:

[gdata 2.0.18 (c:\python34\lib\site-packages), google-api-python-client 1.4.2 (c:\python34\lib\site-packages), httplib2 0.9.2 (c:\python34\lib\site-packages), oauth2client 1.5.1 (c:\python34\lib\site-packages), pip 6.0.8 (c:\python34\lib\site-packages), pyasn1 0.1.9 (c:\python34\lib\site-packages), pyasn1-modules 0.0.8 (c:\python34\lib\site-packages), requests 2.7.0 (c:\python34\lib\site-packages), rsa 3.2.3 (c:\python34\lib\site-packages), setuptools 12.0.5 (c:\python34\lib\site-packages), simplejson 3.8.1 (c:\python34\lib\site-packages), six 1.10.0 (c:\python34\lib\site-packages), uritemplate 0.6 (c:\python34\lib\site-packages)]


5) But when I try to import gdata i get an error:

>>> import gdata.spreadsheet.service
Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    import gdata.spreadsheet.service
  File "C:\Python34\lib\site-packages\gdata\__init__.py", line 26, in <module>
    import atom
  File "C:\Python34\lib\site-packages\atom\__init__.py", line 132, in <module>
    CreateClassFromXMLString)
  File "C:\Python34\lib\site-packages\atom\__init__.py", line 96, in mark_deprecated
    optional_warn_function.func_name = f.func_name
AttributeError: 'function' object has no attribute 'func_name'

Any ideas?

Upvotes: 1

Views: 1170

Answers (1)

davejagoda
davejagoda

Reputation: 2528

Instead of trying to unzip to install, use pip:

http://pip.readthedocs.org/en/stable/installing/

You can install the library using pip install gdata:

https://pythonhosted.org/gdata/installation.html

Update: pip is a good way to install, but this was not actually the problem - the actual root problem was gdata compatibility with python2 vs. python3. The fix that worked is described here: https://github.com/google/gdata-python-client/issues/29

Specifically running this in the site-packages directory:

2to3 -w atom gdata

Be warned this will change many files, so having a backup or recovery strategy in place before beginning is strongly advised.

Upvotes: 1

Related Questions