GithubHelp home page GithubHelp logo

Comments (12)

erickoledadevrel avatar erickoledadevrel commented on May 19, 2024 8

The cause of the problem, and the workaround is best explained here: http://stackoverflow.com/a/29666702/702875

The Google APIs Python client library depends on another library called six, which comes pre-installed with Max OSX. The client library needs a newer version however, and although pip installs it Python ends up loading the older version first, leading to the error.

The workaround is to set the system environment variable PYTHONPATH to point directly to pip's install directory, so that the latest version of the six module loads first.

export PYTHONPATH=/Library/Python/2.7/site-packages

You'll need to add that line to you ~/.bashrc file to ensure it's set for each terminal window.

from google-api-python-client.

goz avatar goz commented on May 19, 2024 1

not yet @pepedocs, downgraded my api client to 1.3.2 since then

from google-api-python-client.

exceptorr avatar exceptorr commented on May 19, 2024 1

Also reproduced on latest google-api-python-client - downgrade to 1.3.2 resolved this issue.

from google-api-python-client.

gasabr avatar gasabr commented on May 19, 2024 1

What can I try if adding didn't help?

from google-api-python-client.

theacodes avatar theacodes commented on May 19, 2024 1

@ohlaylaohoh I really don't recommend using the PYTHONPATH thing. Please use virtualenv.

from google-api-python-client.

pepedocs avatar pepedocs commented on May 19, 2024

Hi gozali,

Have you found a fix for this for version 1.4.1 ? I got the same issue as well.

Cheers,
Pepe

from google-api-python-client.

ymnoor21 avatar ymnoor21 commented on May 19, 2024

Adding export PYTHONPATH=/Library/Python/2.7/site-packages worked for me.

from google-api-python-client.

theacodes avatar theacodes commented on May 19, 2024

This is likely due to an outdated version of six on your system. This can happen with OS X system Python because the Apple-provided six library can't be upgraded.

Have you tried using a virtualenv?

from google-api-python-client.

gogolaylago avatar gogolaylago commented on May 19, 2024

Hi there, I added the PYTHONPATH to bashrc but didn't work. Any idea why?

from google-api-python-client.

tuanchauict avatar tuanchauict commented on May 19, 2024

Use python3 (3.5) and install google-api-python-client-py3 works for me (also need to change these in tools.py of the library

    s.wfile.write("<html><head><title>Authentication Status</title></head>")
    s.wfile.write("<body><p>The authentication flow has completed.</p>")
    s.wfile.write("</body></html>")

to

    s.wfile.write(b"<html><head><title>Authentication Status</title></head>")
    s.wfile.write(b"<body><p>The authentication flow has completed.</p>")
    s.wfile.write(b"</body></html>")

from google-api-python-client.

mcdonc avatar mcdonc commented on May 19, 2024

Triaging.

The correct answer is, if you see this symptom, to use a virtualenv rather than the "system" Python,.
The system Python on some platforms (e.g. MacOS) is populated with packages that are used for system operation, and which may not be compatible with the requirements of the api client.

from google-api-python-client.

mcdonc avatar mcdonc commented on May 19, 2024

I'm going to close this, as there are two solutions named above (and the PYTHONPATH one is even in the official docs), however, if you need more help, please comment, and I'll try to provide it. Thanks!

from google-api-python-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.