Reputation: 221
I am currently trying to use the QGIS plugins to connect MongoDB such as MongoConnector and Load MongoDB Layers. But I couldn´t make it work.
Is there anybody, who uses those plugins or are they broken? Here is the error I got for Load MongoDB Layers plugin
Couldn't load plugin qgis-mongodb-loader due to an error when calling its classFactory() method
Traceback (most recent call last):
File "C:/PROGRA~1/QGISWI~1/apps/qgis-ltr/./python\qgis\utils.py", line 219, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "C:/Users/nilci_000/.qgis2/python/plugins\qgis-mongodb-loader\__init__.py", line 28, in classFactory
from .loadMongoDB import loadMongoDB
File "C:/PROGRA~1/QGISWI~1/apps/qgis-ltr/./python\qgis\utils.py", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/nilci_000/.qgis2/python/plugins\qgis-mongodb-loader\loadMongoDB.py", line 16, in
from loadMongoDB_dialog import loadMongoDBDialog
File "C:/PROGRA~1/QGISWI~1/apps/qgis-ltr/./python\qgis\utils.py", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/nilci_000/.qgis2/python/plugins\qgis-mongodb-loader\loadMongoDB_dialog.py", line 32, in
QMessageBox.critical(iface.mainWindow(),
NameError: name 'iface' is not defined
Python version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
And this is for MongoConnector plugin
Couldn't load plugin MongoConnector due to an error when calling its classFactory() method
Traceback (most recent call last):
File "C:/PROGRA~1/QGISWI~1/apps/qgis-ltr/./python\qgis\utils.py", line 219, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "C:/Users/nilci_000/.qgis2/python/plugins\MongoConnector\__init__.py", line 26, in classFactory
from MongoConnector.plugin import MongoConnectorPlugin
File "C:/PROGRA~1/QGISWI~1/apps/qgis-ltr/./python\qgis\utils.py", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/nilci_000/.qgis2/python/plugins\MongoConnector\plugin.py", line 25, in
from connect_action import ConnectAction
File "C:/PROGRA~1/QGISWI~1/apps/qgis-ltr/./python\qgis\utils.py", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/nilci_000/.qgis2/python/plugins\MongoConnector\connect_action.py", line 29, in
from pymongo import MongoClient
File "C:/PROGRA~1/QGISWI~1/apps/qgis-ltr/./python\qgis\utils.py", line 478, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named pymongo
Python version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
Best, Nilü
Upvotes: 2
Views: 1852
Reputation: 625
Before installing MongoConnector Plugin make sure you have "pymongo" installed in your python. Python and Mongo speak with each other using this.
You can install it from their official link.
It is also mentioned in Mongo Connector page that pymongo should be > 3.0 So it will not work with python 2.7 Ref: https://plugins.qgis.org/plugins/MongoConnector/
After that try installing that plugin again.
Upvotes: 2