Running into an issue with import version
File "/app/.heroku/python/lib/python2.7/site-packages/apiclient/http.py", line 50, in <module>
from model import JsonModel
File "/app/.heroku/python/lib/python2.7/site-packages/apiclient/model.py", line 30, in <module>
from apiclient import __version__
ImportError: cannot import name __version__
Issue Mentions:
http://xmodulo.com/2013/12/integrate-google-calendar-linux-desktop.html
https://github.com/insanum/gcalcli/issues/123
ah, so this is an interesting one. i've updated the other ticket, but in case someone stumbles on this bug:
tl;dr: if you install both google-api-python-client and apiclient, you're gonna have a bad time. both use just apiclient as the import name, which of course leads to bad collisions.
short term, uninstall one or the other, if possible.
longer term, we've already changed the import name for our module, so this will get fixed by our next release.
hopefully that helps -- if not, feel free to reopen!
neither works for me. if i have apiclient separately installed i have the same problem as OP, but if i don't have it separately installed then the error is:
from apiclient.discovery import build
ImportError: No module named apiclient.discovery
The issue is that the tutorial docs are outdated: https://developers.google.com/compute/docs/api/python-guide
they've changed the name from apiclient to googleapiclient
The docs also don't mention that you need to install the googleapiclient dependency separately from google-api-python-client
aha -- thanks @AlexanderPease for letting me know! i'll work on getting those updated soon. (i suspect there are a _lot_ of docs that need updated.)
$ sudo pip install --upgrade googleapiclient
Downloading/unpacking googleapiclient
Real name of requirement googleapiclient is googleapiclient
Could not find any downloads that satisfy the requirement googleapiclient
Cleaning up...
No distributions at all found for googleapiclient
Storing debug log for failure in /home/rschaufler/.pip/pip.log
and still getting
$ gcalcli agenda
ERROR: Missing module - No module named discovery
there's a name mismatch; you want google-api-python-client for the pip command.
@craigcitro I was trying to follow the 8/1/2014 instructions above from @AlexanderPease.
I had already done pip google-api-python-client, and was getting the discovery module not found error.
Moot point, I somehow got past the discovery issue and ran into another issue, leading me to give up entirely on trying to install gclical. If it had this many problems with just installation, I'm not going to trust it to touch my calendar.
@RobinIsTheBird How did you get past the discovery issue?
@elijahcarrel I'm sorry, but I forget now. It was a couple weeks ago, and since there was a later showstopper, I gave up entirely. Binding my google calendar to a separate chrome window is a sufficient solution to reducing my Chrome tab count, while presenting a unique icon to the application switcher, which is what I mainly cared about.
I am also having this problem. Calling googleapiclient.discovery also throws me a "No module named" error....
@chromafunk, @RobinIsTheBird,
After many frustrating hours, I finally got my build to import. Be sure that you have the library googleapiclient within the lib folder in your appengine-flask-skeleton-master directory. If you do not, you should be able to copy it from the Python Frameworks. You might as well take this time to copy over any other import libraries that are not already there (this could be apiclient, httplib2, oauth2client, simplejson, six, uritemplate, urllib3, etc.). I recall having issues with all of them.
On my mac, you can find the Python libraries within:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Now regarding the import call.
from googleapiclient.discovery import build
I could only get this to work when it was within a flask method. for example:
@app.route('/oauth2callback')
def oauth():
from googleapiclient.discovery import build
This was the only way I could get it to work! Hope it helps. Feel free to reach out if you would like to discuss.
@robmorehead It seems your answer was from years ago, but it did fix my problem. thx
I just had the same problem and @robmorehead trick worked 馃挴
Please use:
pip install --upgrade google-api-python-client
This worked perfectly for me in python 2.7 and with python 3.6.5
does anybody know what to do if pip install --upgrade google-api-python-client doesn't help?
I still get:
from googleapiclient.discovery import build
ModuleNotFoundError: No module named 'googleapiclient'
I have the same issue with python 3.6.5 in 2020......
Most helpful comment
@robmorehead It seems your answer was from years ago, but it did fix my problem. thx