Skip to content

from apiclient import __version__ #13

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

Closed
jpoehnelt opened this issue Jun 19, 2014 · 16 comments
Closed

from apiclient import __version__ #13

jpoehnelt opened this issue Jun 19, 2014 · 16 comments
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@jpoehnelt
Copy link

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
insanum/gcalcli#123

@craigcitro
Copy link
Contributor

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!

@AlexanderPease
Copy link

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

@AlexanderPease
Copy link

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

@craigcitro
Copy link
Contributor

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.)

mbeckett7 added a commit to eslao/mars-reports-project that referenced this issue Feb 12, 2015
@RobinIsTheBird
Copy link

$ 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

@craigcitro
Copy link
Contributor

there's a name mismatch; you want google-api-python-client for the pip command.

@RobinIsTheBird
Copy link

@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.

@elijahcarrel
Copy link

@RobinIsTheBird How did you get past the discovery issue?

@RobinIsTheBird
Copy link

@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.

@journeytosilius
Copy link

I am also having this problem. Calling googleapiclient.discovery also throws me a "No module named" error....

@robmorehead
Copy link

@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.

@shawnhero
Copy link

@robmorehead It seems your answer was from years ago, but it did fix my problem. thx

@pedrocaseiro
Copy link

I just had the same problem and @robmorehead trick worked 💯

@AnanyaChandraker
Copy link

Please use:
pip install --upgrade google-api-python-client

This worked perfectly for me in python 2.7 and with python 3.6.5

@ArtinBog
Copy link

ArtinBog commented Sep 15, 2019

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'

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 6, 2020
@jfrazee216
Copy link

I have the same issue with python 3.6.5 in 2020......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests