Skip to content
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

Attribute error in "discovery.py" in quickstart example #63

Closed
TopiKeittiot opened this issue Jan 2, 2019 · 5 comments
Closed

Attribute error in "discovery.py" in quickstart example #63

TopiKeittiot opened this issue Jan 2, 2019 · 5 comments
Assignees

Comments

@TopiKeittiot
Copy link

TopiKeittiot commented Jan 2, 2019

Hello,

While attempting to follow the quickstart guide for the Google calendar python API https://developers.google.com/calendar/quickstart/python I run in to the following error. My code is currently identical to the one in the link.

Traceback (most recent call last):
  File "C:/Users/Topi/PycharmProjects/Random/WebDataScrape/quickstart.py", line 39, in <module>
    main()
  File "C:/Users/Topi/PycharmProjects/Random/WebDataScrape/quickstart.py", line 22, in main
    service = build('calendar', 'v3', http=creds.authorize(Http()))
  File "C:\Users\Topi\AppData\Local\Programs\Python\Python36\lib\site-packages\googleapiclient\_helpers.py", line 130, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "C:\Users\Topi\AppData\Local\Programs\Python\Python36\lib\site-packages\googleapiclient\discovery.py", line 218, in build
    requested_url = uritemplate.expand(discovery_url, params)
AttributeError: module 'uritemplate' has no attribute 'expand'

The authentication proceeds as expected by opening the browser and prompting me to allow the application. After this though the above error appears on every run.

  • Python version 3.6.3
  • Windows 10
@erickoledadevrel erickoledadevrel self-assigned this Jan 22, 2019
@erickoledadevrel
Copy link

Strange. The uritemplate module is a dependency of the library, and it hasn't changed in years:

https://pypi.org/project/uritemplate/

Can you try installing that module directly? Could there be some other module on your system with the same name?

@erickoledadevrel
Copy link

Closing due to inactivity.

@jippylong12
Copy link

jippylong12 commented Jun 11, 2019

Howdy all,

I was able to resolve the issue. If you install version 3.0.2 of uritemplate the error goes away. I myself had version 3.0.0.

Not sure why but there are three different uritemplates on the https://pypi.python.org/simple feed and PyCharm will choose to install the one with 3.0.0.

@mkubryn7bulls
Copy link

@jippylong12 where did you find the version 3.0.2 of the uritemplate package? Even their official repo (https://github.com/python-hyper/uritemplate/releases) contains 3.0.0 only

@jippylong12
Copy link

I'm not sure how specifically to find it, I just know that if you go to the feed of pypi.python.org then you can see the different options. When using PyCharm you can go to Settings->Project Interpreter, click the plus icon, search for uritemplate and then you will find uritemplate.py which is the one you should install over uritemplate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants