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

Plugin fails to initialize with AttributeError: module 'six.moves' has no attribute 'collections_abc' #67

Closed
keepcool13 opened this issue Sep 25, 2020 · 8 comments
Assignees

Comments

@keepcool13
Copy link

keepcool13 commented Sep 25, 2020

I have installed the current version (0.0.2) of the plugin. When starting QGIS, I get a window that says:

Couldn't load plugin 'ee_plugin' due to an error when calling its classFactory() method
AttributeError: module 'six.moves' has no attribute 'collections_abc'
Traceback (most recent call last):
File "/Applications/QGIS3.12.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 334, in _startPlugin
plugins[packageName] = package.classFactory(iface)
File "/Users/marius/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/init.py", line 25, in classFactory
from .ee_plugin import GoogleEarthEnginePlugin
File "/Applications/QGIS3.12.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 744, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/marius/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/ee_plugin.py", line 26, in
ee_plugin.ee_auth.init()
File "/Users/marius/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/ee_auth.py", line 19, in init
ee.Initialize()
File "/Users/marius/Library/Python/3.7/lib/python/site-packages/ee/init.py", line 123, in Initialize
http_transport=http_transport)
File "/Users/marius/Library/Python/3.7/lib/python/site-packages/ee/data.py", line 210, in initialize
_install_cloud_api_resource()
File "/Users/marius/Library/Python/3.7/lib/python/site-packages/ee/data.py", line 287, in _install_cloud_api_resource
http_transport=_http_transport)
File "/Users/marius/Library/Python/3.7/lib/python/site-packages/ee/_cloud_api_utils.py", line 149, in build_cloud_resource
model=alt_model)
File "/Users/marius/Library/Python/3.7/lib/python/site-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Users/marius/Library/Python/3.7/lib/python/site-packages/googleapiclient/discovery.py", line 288, in build
adc_key_path=adc_key_path,
File "/Users/marius/Library/Python/3.7/lib/python/site-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Users/marius/Library/Python/3.7/lib/python/site-packages/googleapiclient/discovery.py", line 466, in build_from_document
if isinstance(client_options, six.moves.collections_abc.Mapping):
AttributeError: module 'six.moves' has no attribute 'collections_abc' `

Python version: 3.7.3 (default, Mar 27 2019, 09:23:15) [Clang 10.0.1 (clang-1001.0.46.3)]
QGIS version: 3.12.2-București București, 8a1fb33634

Python Path:
/Applications/QGIS3.12.app/Contents/MacOS/../Resources/python
/Users/marius/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/marius/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS3.12.app/Contents/MacOS/../Resources/python/plugins
/Applications/QGIS3.12.app/Contents/Resources/python
/Applications/QGIS3.12.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7
/Applications/QGIS3.12.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python37.zip
/Applications/QGIS3.12.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/site-packages
/Applications/QGIS3.12.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/lib-dynload
/Users/marius/Library/Python/3.7/lib/python/site-packages
/Applications/QGIS3.12.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.7/site-packages/geos
/Users/marius/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/marius/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_darwin

I get the same error when typing
import ee
ee.Initialize()
in the QGIS Python console.

I authenticated the Python API in Terminal, similar to how asuhag did it here. In Terminal the API works fine. I use QGIS 3.12.2 and Python 3.7.3 on MacOS 10.15.6. I have updated six to the current version (1.15.0) and confirmed in the documentation that six does in fact have an attribute called collections_abc. What could be the cause of that error?

@keepcool13 keepcool13 changed the title EE fails to initialize with AttributeError: module 'six.moves' has no attribute 'collections_abc' Plugin fails to initialize with AttributeError: module 'six.moves' has no attribute 'collections_abc' Sep 25, 2020
@keepcool13
Copy link
Author

keepcool13 commented Sep 25, 2020

Looking again at the traceback, I realised that the bug actually is not from here, but from the Google Python API Client. Someone else had the same problem, but with a different API just 3 days ago: googleapis/google-api-python-client#1039 But it has something to do with this plugin, because if I call ee.Initialize() in a standard Python console, the bug doesn't appear. This seems quite mysterious.

@XavierCLL
Copy link
Collaborator

XavierCLL commented Sep 25, 2020

Hi,
That happens because the plugin has all external libraries that need to work and this includes the Earth Engine API and you are using some libs with different versions in your system that maybe are in conflict (I think that we need to release another version with all libraries updated).

If you have all GEE libraries working in your system try to delete all folders in the following directory and restart the Qgis:

/Users/marius/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/ee_plugin/extlibs_darwin/*

@keepcool13
Copy link
Author

Hi,
thanks for your answer, but your suggestion didn't work. Do you have any idea what else could be the problem?

@XavierCLL
Copy link
Collaborator

XavierCLL commented Sep 25, 2020

then try to build the plugin by yourself, first uninstall the plugin, download the plugin code, run paver setup and paver package
and install the zip generated.

https://github.com/gee-community/qgis-earthengine-plugin#for-developers

@gena
Copy link
Collaborator

gena commented Oct 6, 2020

then try to build the plugin by yourself, first uninstall the plugin, download the plugin code, run paver setup and paver package
and install the zip generated.

https://github.com/gee-community/qgis-earthengine-plugin#for-developers

This could be a challenge for non-dev users

@keepcool13 can you try uninstalling earthengine-api in your global Python environment and restart QGIS, this could be a conflict between EE versions and see what happens?

@SiggyF
Copy link
Collaborator

SiggyF commented Nov 13, 2020

This issue can be caused by an old six version. The module six.moves.collections_abc requires six>=1.13

SiggyF added a commit that referenced this issue Nov 13, 2020
@gena
Copy link
Collaborator

gena commented Nov 13, 2020

@SiggyF, six-1.15.0 is included with the plugin, for v0.0.2 and experimental v0.0.3, while the v0.0.1 uses six-1.13.0. So this must be something else, the conflicts are in the system Python installation

@gena
Copy link
Collaborator

gena commented Jan 7, 2021

Closing for no reply. This should work by now.

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