1

I have installed the custom plugin which was created through plugin builder 3. I just added an import pymango statement and have deployed the plugin to QGIS. This gave below error with stacktrace.

ModuleNotFoundError: No module named 'pymongo'

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 335, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/home/ubuntu/.local/share/QGIS/QGIS3/profiles/default/python/plugins/sample/__init__.py", line 35, in classFactory
    from .sample import custom_plugin
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 672, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/ubuntu/.local/share/QGIS/QGIS3/profiles/default/python/plugins/sample/custom_plugin.py", line 33, in 
    import pymongo
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 672, in _import
        mod = _builtin_import(name, globals, locals, fromlist, level)
    ModuleNotFoundError: No module named 'pymongo'

Python Path:
/usr/share/qgis/python
/home/ubuntu/.local/share/QGIS/QGIS3/profiles/default/python
/home/ubuntu/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/lib/python36.zip
/usr/lib/python3.6
/usr/lib/python3.6/lib-dynload
/home/ubuntu/.local/lib/python3.6/site-packages
/usr/local/lib/python3.6/dist-packages
/usr/lib/python3/dist-packages
/home/ubuntu/.local/share/QGIS/QGIS3/profiles/default/python

The pymango python library is installed in /home/ubuntu/.local/lib/python3.6/site-packages folder. You can see this folder in python path, still QGIS3.6 desktop application is not able to locate the package. It is not detecting any external Python package that I installed. Any solution?

System details:

Python version: 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0]

QGIS version: 3.6.0-Noosa Noosa, 5873452

Ubuntu: 18.04

1

I had the same problem during the installation of mongoconector plugin in QGIS 3.6.0-Noosa with Ubuntu 18.04. I solved it installing pymongo from repositories :

sudo apt install python3-pymongo
  • Great! Thanks this worked for me. – Amar Kamthe Mar 12 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.