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 won't load in QGIS 3.16 #140

Closed
e42mercury opened this issue Nov 23, 2020 · 10 comments
Closed

Plugin won't load in QGIS 3.16 #140

e42mercury opened this issue Nov 23, 2020 · 10 comments

Comments

@e42mercury
Copy link

I can't load the plugin on mac OS with QGIS 3.16. I get the following error:

Couldn't load plugin 'qgis-maptiler-plugin' due to an error when calling its classFactory() method 

ImportError: dlopen(/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/Pillow-7.2.0-py3.7-macosx-10.13.0-x86_64.egg/PIL/_imaging.cpython-37m-darwin.so, 2): Library not loaded: /opt/X11/lib/libxcb.1.dylib   Referenced from: /Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/Pillow-7.2.0-py3.7-macosx-10.13.0-x86_64.egg/PIL/_imaging.cpython-37m-darwin.so   Reason: image not found 
Traceback (most recent call last):
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 334, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/Users/erik/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/qgis-maptiler-plugin/__init__.py", line 35, in classFactory
    from .maptiler import MapTiler
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/erik/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/qgis-maptiler-plugin/maptiler.py", line 34, in 
    from .browser_root_collection import DataItemProvider
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/erik/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/qgis-maptiler-plugin/browser_root_collection.py", line 7, in 
    from .browser_mapitem import MapDataItem
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/erik/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/qgis-maptiler-plugin/browser_mapitem.py", line 11, in 
    from .gl2qgis import converter
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Users/erik/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/qgis-maptiler-plugin/gl2qgis/converter.py", line 19, in 
    from PIL import Image
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/Pillow-7.2.0-py3.7-macosx-10.13.0-x86_64.egg/PIL/Image.py", line 94, in 
    from . import _imaging as core
  File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: dlopen(/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/Pillow-7.2.0-py3.7-macosx-10.13.0-x86_64.egg/PIL/_imaging.cpython-37m-darwin.so, 2): Library not loaded: /opt/X11/lib/libxcb.1.dylib
  Referenced from: /Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/Pillow-7.2.0-py3.7-macosx-10.13.0-x86_64.egg/PIL/_imaging.cpython-37m-darwin.so
  Reason: image not found


Python version: 3.7.7 (default, Sep 22 2020, 10:25:18) [Clang 12.0.0 (clang-1200.0.32.2)] 
QGIS version: 3.16.0-Hannover Hannover, 4af1cbfb97 

Python Path:
/Users/erik/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/leastcostpath
/Applications/QGIS.app/Contents/MacOS/../Resources/python
/Users/erik/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/erik/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/netCDF4-1.5.3-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/pandas-1.1.0-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/affine-2.3.0-py3.7.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/lib-dynload
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/snuggs-1.4.7-py3.7.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/Rtree-0.9.4-py3.7.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/numba-0.50.1-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/Pillow-7.2.0-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/pyproj-2.6.0-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/click_plugins-1.1.1-py3.7.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/statsmodels-0.11.1-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/scipy-1.5.1-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/numpy-1.19.1-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/rasterio-1.1.5-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/GDAL-3.1.2-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/patsy-0.5.1-py3.7.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/cftime-1.2.1-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/matplotlib-3.3.0-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/opencv_contrib_python-4.3.0.36-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python37.zip
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/geopandas-0.8.1-py3.7.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/Fiona-1.8.13.post1-py3.7-macosx-10.13.0-x86_64.egg
/Users/erik/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/erik/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/DigitizingTools/tools
/Users/erik/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/DigitizingTools
/Users/erik/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/mmqgis/forms
@lazaa32
Copy link
Collaborator

lazaa32 commented Nov 24, 2020

Hi @e42mercury,

it looks like an issue with Python Pillow library. How did you install it? Can you try to upgrade it to the latest version? That might help.

@e42mercury
Copy link
Author

The 3.16.1 mac build is not available from the download page. I tried with the nightly build of 3.17.0 and got the same result.
I wonder if this is because I'm still using macOS 10.13.

@lazaa32
Copy link
Collaborator

lazaa32 commented Nov 30, 2020

I meant upgrade of Python Pillow library. I can see that you have version 7.2.0:

ImportError: dlopen(/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/Pillow-7.2.0-py3.7-macosx-10.13.0-x86_64.egg/PIL/_imaging.cpython-37m-darwin.so, 2): Library not loaded: /opt/X11/lib/libxcb.1.dylib   Referenced from: /Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/Pillow-7.2.0-py3.7-macosx-10.13.0-x86_64.egg/PIL/_imaging.cpython-37m-darwin.so   Reason: image not found 
Traceback (most recent call last):

But the latest version is 8.0.1.
Could you try to upgrade this library?

@e42mercury
Copy link
Author

I upgraded pip and pillow (following these instructions), which worked. But QGIS is still using the old version (inside the application contents). Do I need to reinstall QGIS? Do you know how I can get get QGIS to use the new versions?

@lazaa32
Copy link
Collaborator

lazaa32 commented Dec 1, 2020

Sorry, I am not familiar with package and library management on OSX. Do you know how did you get the old version installed? I would try first to reinstall QGIS, if that doesn't help I would try to modify Python path and remove path to the old version and make sure that there is a path to latest version of Pillow.

@michaelrnz
Copy link

It seems that those packages are actually wrapped up in the macOS release of QGIS if I am reading it right. I'm hitting the same issue, not a massive macOS person so i'm guessing at it. I got the issue on Catalina and Big Sur as of 3.16+. It seems we might need to raise this with the QGIS macOS maintainers?

@lazaa32
Copy link
Collaborator

lazaa32 commented Dec 1, 2020

Hi @michaelrnz ,
you are probably right. I just ran into this blogpost: https://www.lutraconsulting.co.uk/blog/2020/10/01/qgis-macos-package/
Guys from Lutra are really QGIS experts so I believe they can give you a hint.

@michaelrnz
Copy link

michaelrnz commented Dec 1, 2020

@lazaa32 You just saved my bacon, I just ran the following and then was able to launch QGIS and the MapTiler plugin with no worries! That article provided the answer 👍

/Applications/QGIS.app/Contents/MacOS/bin/pip3 install pillow -U
Collecting pillow
  Downloading Pillow-8.0.1-cp37-cp37m-macosx_10_10_x86_64.whl (2.2 MB)
     |████████████████████████████████| 2.2 MB 4.8 MB/s 
Installing collected packages: pillow
  Attempting uninstall: pillow
    Found existing installation: Pillow 7.2.0
    Uninstalling Pillow-7.2.0:
      Successfully uninstalled Pillow-7.2.0
Successfully installed pillow-8.0.1

@lazaa32
Copy link
Collaborator

lazaa32 commented Dec 1, 2020

Oh, that's great! Thanks @michaelrnz for feedback and working solution.
@e42mercury please let me know if this works for you as well.

@e42mercury
Copy link
Author

Yes, this solution worked great for me! @lazaa32 and @michaelrnz, thanks so much. Now I can get back to using this great plugin. I opened an issue about this so hopefully the QGIS people will include the pillow update in the next release.

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

No branches or pull requests

3 participants