Comments (12)
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.
not yet @pepedocs, downgraded my api client to 1.3.2 since then
from google-api-python-client.
Also reproduced on latest google-api-python-client - downgrade to 1.3.2 resolved this issue.
from google-api-python-client.
What can I try if adding didn't help?
from google-api-python-client.
@ohlaylaohoh I really don't recommend using the PYTHONPATH thing. Please use virtualenv.
from google-api-python-client.
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.
Adding export PYTHONPATH=/Library/Python/2.7/site-packages
worked for me.
from google-api-python-client.
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.
Hi there, I added the PYTHONPATH to bashrc but didn't work. Any idea why?
from google-api-python-client.
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.
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.
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)
- Main
- Update or remove docs/epy
- urllib3 seems to consider the endpoint as the http method HOT 2
- MediaIoBaseDownload Cannot Handle Resuming Partial Download HOT 2
- Payment option is invisible the option HOT 1
- Compressing the discovery cache HOT 1
- Einträge verwalten
- when will this library be built again HOT 1
- Release notes should indicate when new API versions are added HOT 1
- Can we suppress Google from automatically trying to refresh on expired tokens? HOT 1
- Warning: a recent release failed HOT 1
- Update Group allowExternalMembers not updating HOT 1
- oauth2client needs to be frozen at version 3.0.0 in order to work HOT 1
- Warning: a recent release failed
- Need the Correct Versions of google-auth and google-api-python-client for Python 3.9 Runtime to Resolve MTLS Missing Issue HOT 3
- HttpMockSequence is missing close() method HOT 1
- Missing aplications for report_v1 API HOT 1
- Highlight code syntax in the readme file for better visibility
- Add tests for validating credentials for the configured universe once leveraged.
- Inconsistency in doc : OAuth for Installed Applications
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-api-python-client.