lymperis-e / qgis_remote_db_plugin

A QGIS plugin to open SSH connections to remote database servers
https://plugins.qgis.org/plugins/remote_db/
GNU General Public License v3.0
4 stars 1 forks source link

Couldn't load plugin 'remote_db' due to an error when calling its classFactory() method #2

Closed rauchm81 closed 8 months ago

rauchm81 commented 1 year ago

Hi, I´ve tried to install your plugin (which I´m really thankful for). Unfortunately the installation fails, here´s the error log:

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

ModuleNotFoundError: No module named 'paramiko' 
Traceback (most recent call last):
  File "C:/Users/uid10607/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\core\Connection.py", line 8, in 
    from .sshtunnel.sshtunnel import SSHTunnelForwarder
  File "C:/PROGRA~1/QGIS3~1.18/apps/qgis/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/uid10607/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\core\sshtunnel\sshtunnel.py", line 54, in 
    import paramiko
  File "C:/PROGRA~1/QGIS3~1.18/apps/qgis/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'paramiko'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS3~1.18/apps/qgis/./python\qgis\utils.py", line 335, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/uid10607/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\__init__.py", line 35, in classFactory
    from .remote_db import RemoteDB
  File "C:/PROGRA~1/QGIS3~1.18/apps/qgis/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/uid10607/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\remote_db.py", line 32, in 
    from .core.ConnectionManager import ConnectionManager
  File "C:/PROGRA~1/QGIS3~1.18/apps/qgis/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/uid10607/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\core\ConnectionManager.py", line 3, in 
    from .Connection import Connection
  File "C:/PROGRA~1/QGIS3~1.18/apps/qgis/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/uid10607/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\core\Connection.py", line 14, in 
    from .sshtunnel.sshtunnel import SSHTunnelForwarder
  File "C:/PROGRA~1/QGIS3~1.18/apps/qgis/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/uid10607/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\core\sshtunnel\sshtunnel.py", line 54, in 
    import paramiko
  File "C:/PROGRA~1/QGIS3~1.18/apps/qgis/./python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'paramiko'

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.18.3-Zürich Zürich, 735cc85be9 

Python Path:
C:/PROGRA~1/QGIS3~1.18/apps/qgis/./python
C:/Users/uid10607/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/uid10607/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.18/apps/qgis/./python/plugins
C:\PROGRA~1\QGIS3~1.18\apps\Python37
C:\PROGRA~1\QGIS3~1.18\apps\Python37\Scripts
C:\Program Files\QGIS 3.18\bin\python37.zip
C:\PROGRA~1\QGIS3~1.18\apps\Python37\DLLs
C:\PROGRA~1\QGIS3~1.18\apps\Python37\lib
C:\Program Files\QGIS 3.18\bin
C:\PROGRA~1\QGIS3~1.18\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS3~1.18\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.18\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.18\apps\Python37\lib\site-packages\Pythonwin
C:/Users/uid10607/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\uid10607\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\mmqgis/forms
lymperis-e commented 1 year ago

@rauchm81 thank you for reaching out! When you first isntalled or initialized the plugin, did you get a prompt to install some dependencies?

In any case, you should be able to install any missing dependencies by opening the python console from within QGIS, and running:

import subprocess
subprocess.check_call(['pip', 'install', 'paramiko'])
rauchm81 commented 1 year ago

Thanks @lymperis-e for your quick response. With your latest commit https://github.com/lymperis-e/qgis_remote_db_plugin/commit/d38029f67a3678ce0503c0af74432ec30ea84312 the plugin installs fine.