module 'six.moves' has no attribute 'collections_abc
See original GitHub issueThanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Please run down the following list and make sure you’ve tried the usual “quick fixes”:
- Search the issues already opened: https://github.com/googleapis/google-api-python-client/issues
- Search StackOverflow: https://stackoverflow.com/questions/tagged/google-cloud-platform+python
If you are still having issues, please be sure to include as much information as possible:
Environment details
- MacOS Catalina:
- Python version: 3.6.5
- pip version: 21.0.1
google-api-python-client
version:2.0.2
Steps to reproduce
- install google-api-python-client
- run the code
Code example
youtube = discovery.build('youtube', 'v3', static_discovery=False)
request = youtube.search().list(
part="snippet",
maxResults=25,
q="surfing"
)
response = request.execute()
print(response)
Stack trace
AttributeError Traceback (most recent call last)
<ipython-input-202-2092acf85a22> in <module>()
24 print(response)
25
---> 26 serialized_users = search_users(queries)
<ipython-input-202-2092acf85a22> in search_users(queries)
3 for query in queries:
4 search_twitter(query, results)
----> 5 search_youtube(query, results)
6 return results
7
<ipython-input-202-2092acf85a22> in search_youtube(query, results)
14
15 def search_youtube(query, results):
---> 16 youtube = discovery.build('drive', 'v3', static_discovery=False)
17 request = youtube.search().list(
18 part="snippet",
~/anaconda3/lib/python3.6/site-packages/googleapiclient/_helpers.py in positional_wrapper(*args, **kwargs)
132 elif positional_parameters_enforcement == POSITIONAL_WARNING:
133 logger.warning(message)
--> 134 return wrapped(*args, **kwargs)
135
136 return positional_wrapper
~/anaconda3/lib/python3.6/site-packages/googleapiclient/discovery.py in build(serviceName, version, http, discoveryServiceUrl, developerKey, model, requestBuilder, credentials, cache_discovery, cache, client_options, adc_cert_path, adc_key_path, num_retries, static_discovery)
292 client_options=client_options,
293 adc_cert_path=adc_cert_path,
--> 294 adc_key_path=adc_key_path,
295 )
296 break # exit if a service was created
~/anaconda3/lib/python3.6/site-packages/googleapiclient/_helpers.py in positional_wrapper(*args, **kwargs)
132 elif positional_parameters_enforcement == POSITIONAL_WARNING:
133 logger.warning(message)
--> 134 return wrapped(*args, **kwargs)
135
136 return positional_wrapper
~/anaconda3/lib/python3.6/site-packages/googleapiclient/discovery.py in build_from_document(service, base, future, http, developerKey, model, requestBuilder, credentials, client_options, adc_cert_path, adc_key_path)
491 if client_options is None:
492 client_options = google.api_core.client_options.ClientOptions()
--> 493 if isinstance(client_options, six.moves.collections_abc.Mapping):
494 client_options = google.api_core.client_options.from_dict(client_options)
495
AttributeError: module 'six.moves' has no attribute 'collections_abc'
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
module 'six.moves' has no attribute 'collections_abc'
simply run pip install --upgrade six The cause of this issue is usually that the module 'six' in your local environment is out...
Read more >module 'six.moves' has no attribute 'collections_abc'" · Issue ...
I encountered this error message when I was trying to use google analytics API in python AttributeError: module 'six.moves' has no attribute ...
Read more >module 'six.moves' has no attribute 'collections_abc'
AttributeError : module 'six.moves' has no attribute 'collections_abc · Uninstall and download sources : · Change setup.py by changing · Install ...
Read more >Six: Python 2 and 3 Compatibility Library — six 1.15.0 ...
Create a mapping for six.moves called name that references different attributes in Python 2 and 3. old_mod is the name of the Python...
Read more >attributeerror: module 'collections' has no attribute 'sequence'
Deprecated since version 3.3, will be removed in version 3.10: Moved Collections Abstract Base Classes to the collections.abc module. For backwards ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On the unrelated note, I agree. I was just trying to see if anything would fix it.
On the topic of six being too old, when i run
pip show six --version
I get this as the module dataSo I feel like it should be using the newest version of six
Hi,
It looks like the version of
six
that’s currently installed is too old. Could you try upgrading your version ofsix
?collections_abc
was added in 1.13.0 (six changelog) so our setup.py pinssix>=1.13.0
. Strange things can happen in existing environments sometimes though.Unrelated: I would strongly recommend going with
static_discovery=True
(the new default behavior) for better reliability. Otherwise behavior may change unexpectedly between different executions of the same code. https://github.com/googleapis/google-api-python-client/blob/master/UPGRADING.md#200-migration-guide