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

QGIS "Manage and Install Plugins" load error #16

Closed
gouldingken opened this issue Dec 13, 2021 · 8 comments
Closed

QGIS "Manage and Install Plugins" load error #16

gouldingken opened this issue Dec 13, 2021 · 8 comments
Assignees

Comments

@gouldingken
Copy link

I installed the plugin using the "Manage and Install Plugins" dialog, then received the error below (which also locked up the QGIS UI until I found the error window hidden beneath).

After dismissing the error window, I clicked the button to reinstall the experimental version, reopened QGIS and it appears to be working, but I thought I'd report the error here in case its helpful.

Plugin Version: 0.0.6 (Nov 9th)

Error:

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

ModuleNotFoundError: No module named 'specklepy' 
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS3~1.16/apps/qgis/./python\qgis\utils.py", line 334, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "//dname/users$/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\speckle-qgis\__init__.py", line 43, in classFactory
    from .speckle_qgis import SpeckleQGIS
  File "C:/PROGRA~1/QGIS3~1.16/apps/qgis/./python\qgis\utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "//dname/users$/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\speckle-qgis\speckle_qgis.py", line 31, in 
    from specklepy.api import operations
  File "C:/PROGRA~1/QGIS3~1.16/apps/qgis/./python\qgis\utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'specklepy'


Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.16.1-Hannover Hannover, b381a90dca 

Python Path:
C:/PROGRA~1/QGIS3~1.16/apps/qgis/./python
//dname/users$/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python
//dname/users$/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.16/apps/qgis/./python/plugins
C:\PROGRA~1\QGIS3~1.16\apps\Python37
C:\PROGRA~1\QGIS3~1.16\apps\Python37\Scripts
C:\Program Files\QGIS 3.16\bin\python37.zip
C:\PROGRA~1\QGIS3~1.16\apps\Python37\DLLs
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib
C:\Program Files\QGIS 3.16\bin
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\Pythonwin
//dname/users$/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python

===========================================

Visit https://download.qgis.org to get your copy of version 3.16.14
@AlanRynne
Copy link
Contributor

Thanks for pinging us on this. In theory, specklepy should be automatically installed for you on the first time the plugin runs, but it looks like we may not have covered all cases.

I'll test with your version specifically, as I'm using QGIS 3.20 in my machine to develop it.

@AlanRynne AlanRynne self-assigned this Dec 14, 2021
@AlanRynne
Copy link
Contributor

Hey @gouldingken!

We'll be releasing a new version sometime today that should also do a better job at installing the dependencies.

Closing this, but feel free to re-open if you bump into this again.

@sanzoghenzo
Copy link
Contributor

Hi there, just tried to install the plugin on QGIS 3.20.1, the same error occurs

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

ModuleNotFoundError: No module named 'specklepy' 
Traceback (most recent call last):
  File "C:\PROGRA~1/QGIS32~1.1/apps/qgis/./python\qgis\utils.py", line 335, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:\Users/a.ghensi/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\speckle-qgis\__init__.py", line 43, in classFactory
    from .speckle_qgis import SpeckleQGIS
  File "C:\PROGRA~1/QGIS32~1.1/apps/qgis/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/a.ghensi/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\speckle-qgis\speckle_qgis.py", line 31, in 
    from specklepy.api import operations
  File "C:\PROGRA~1/QGIS32~1.1/apps/qgis/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'specklepy'


Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] 
QGIS version: 3.20.1-Odense Odense, 1c3c5cd6 

Python Path:
C:\Users/a.ghensi/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour
C:/PROGRA~1/QGIS32~1.1/apps/qgis/./python
C:/Users/a.ghensi/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/a.ghensi/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS32~1.1/apps/qgis/./python/plugins
C:\Program Files\QGIS 3.20.1\bin\python39.zip
C:\PROGRA~1\QGIS32~1.1\apps\Python39\DLLs
C:\PROGRA~1\QGIS32~1.1\apps\Python39\lib
C:\Program Files\QGIS 3.20.1\bin
C:\PROGRA~1\QGIS32~1.1\apps\Python39
C:\PROGRA~1\QGIS32~1.1\apps\Python39\lib\site-packages
C:\PROGRA~1\QGIS32~1.1\apps\Python39\lib\site-packages\win32
C:\PROGRA~1\QGIS32~1.1\apps\Python39\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS32~1.1\apps\Python39\lib\site-packages\Pythonwin
C:/Users/a.ghensi/AppData/Roaming/QGIS/QGIS3\profiles\default/python

The problem is a QGIS plugin doesn't carry its dependencies, and there's no way to declare pip dependencies for now (see this issue).

It is stated on the "Publishing a plugin" page:

If the plugin has an external dependency, this needs to be clearly stated in the About metadata field; you can include a short guide to install Python libs as needed, or point to existing guides, e.g. for Windows https://landscapearchaeology.org/2018/installing-python-packages-in-qgis-3-for-windows/

Another QGIS plugin, EnMAP-Box, solved this issue by providing a dependency installer (I didn't use nor test it).
Here the GLP v3 source code.

@sanzoghenzo
Copy link
Contributor

Sorry, I just saw that you already took care of the dependencies installation, but clearly it doesn't always work.

@AlanRynne
Copy link
Contributor

Hi @sanzoghenzo, thanks for reaching out!

We're still waiting for the version I released on Monday to be approved by the QGIS marketplace. If you installed it from there, it may just be that you got an older version that still had that issue.

That being said, I am aware of the QGIS limitation, which is why we're ensuring pip is installed, and any other dependencies such as specklepy; although I agree that since QGIS has multiple ways of being installed; there may be edge cases we haven't accounted for yet.

Let me know if you were installing the plugin straight form the repo, as that would mean there is still work to be done on that side. Thanks for the dependency installer suggestion though!

@sanzoghenzo
Copy link
Contributor

Hi @AlanRynne
I confirm that I was installing the version listed in the plugin manager!

I'll check the new version when it'll become available there (just to make sure my colleagues won't run into troubles 😉 )

@AlanRynne
Copy link
Contributor

AlanRynne commented Feb 2, 2022

Oh, then that's hopefully good news! Not sure whats going on with the QGIS Marketplace but it's been 9 days since we pushed and update and still haven't heard back from them. I'll ping you here once it's finally out so you can confirm it's working for you (afaik, it should!).

EDIT: @sanzoghenzo It's been approved! Can you make sure you have version 0.1.0 installed and try again? 🙏🏼

@sanzoghenzo
Copy link
Contributor

@AlanRynne sorry for the late reply, it's working! thanks

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

3 participants