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

ModuleNotFoundError: No module named 'paramiko' #5

Open F-I-D-O opened 2 months ago

F-I-D-O commented 2 months ago

The plugin fails to activate due to failed paramiko installation:

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/david/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\core\Connection.py", line 7, in 
    from .sshtunnel.sshtunnel import SSHTunnelForwarder
  File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/david/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\core\sshtunnel\sshtunnel.py", line 55, in 
    import paramiko
  File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 892, 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:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 423, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:\Users/david/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\__init__.py", line 35, in classFactory
    from .remote_db import RemoteDB
  File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/david/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\remote_db.py", line 32, in 
    from .core.ConnectionManager import ConnectionManager
  File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/david/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\core\ConnectionManager.py", line 3, in 
    from .Connection import Connection
  File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/david/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\core\Connection.py", line 14, in 
    from .sshtunnel.sshtunnel import SSHTunnelForwarder
  File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/david/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\remote_db\core\sshtunnel\sshtunnel.py", line 55, in 
    import paramiko
  File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 892, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'paramiko'

Python version: 3.9.18 (heads/master:5eba59e, Feb  1 2024, 20:02:10) [MSC v.1929 64 bit (AMD64)] 
QGIS version: 3.34.5-Prizren Prizren, 4b308492 

Python Path:
C:/OSGeo4W/apps/qgis-ltr/./python
C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGeo4W/apps/qgis-ltr/./python/plugins
C:\OSGeo4W\bin\python39.zip
C:\OSGeo4W\apps\Python39\DLLs
C:\OSGeo4W\apps\Python39\lib
C:\OSGeo4W\bin
C:\OSGeo4W\apps\Python39
C:\OSGeo4W\apps\Python39\lib\site-packages
C:/Users/david/AppData/Roaming/QGIS/QGIS3\profiles\default/python

I have QGIS as a part of OSGEO on Windows.

dajtxx commented 1 week ago

I am sorry I cannot help with Windows but I had the same problem on MacOS and perhaps the solution is similar.

QGIS seems to have its own python installation, so I used pip to install paramiko like this:

cd /Applications/QGIS.app/Contents/MacOS/bin
./pip3 install -t /Applications/QGIS.app/Contents/Resources/python/site-packages paramiko