1

I am having problems installing "Location Lab" plugin in QGIS 3.2 (Mac OSX High Sierra).

Looking for an option to run gravity models in QGIS, I've found the Location Lab plugin for QGIS, but the problem is that I could not been able to install it, every time I got this message:

ModuleNotFoundError: No module named 'PyQt4' Traceback (most recent call last): File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 337, in startPlugin plugins[packageName] = package.classFactory(iface) File "/Users/davlira82/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/location_lab/init.py", line 26, in classFactory from .location_lab import LocationLab File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 665, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "/Users/davlira82/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/location_lab/location_lab.py", line 24, in from PyQt4.QtCore import QSettings, QTranslator, qVersion, QCoreApplication File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 665, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ModuleNotFoundError: No module named 'PyQt4'

I've already installed PyQt and upgraded QGIS from 3.0 to 3.2, but I receive the same message again and again. I'm actually an urban planner not a coder, I do not know what else to do.

1
  • 1
    How are you installing this? It shouldn't appear in the "install plugin" list for QGIS 3.
    – Spacedman
    Jul 29, 2018 at 21:23

1 Answer 1

1

this error:-

_builtin_import(name, globals, locals, fromlist, level) ModuleNotFoundError: No module named 'PyQt4'

suggests it's looking for Qt version 4. (Qt is the software which does the user interface, and other things like connections to the internet)

When upgrading to QGIS 3.x, there was a change to use Qt 5. That suggests that this plugin was written for QGIS 2.x and hasn't been rewritten for QGIS 3. You could check out the Github page to see if there's any work being done on rewriting this to work on QGIS 3.

The good news is that on the Mac, it's quite possible to have QGIS 2.18 and QGIS 3.x in separate installations. So you could always use 2.18 for those projects that need this plugin (but be careful to only open and save those in QGIS 2.18). You can still download 2.18 from the QGIS website.

1
  • Thank you for the answer, I already installed QGIS 2.18 again and the plugin did not have any problem to run. For the time being this is going to be my solution. I hope developers of the Location Lab plugin can write it for QGIS 3. Aug 1, 2018 at 22:02

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.