Skip to content

HotSpot Analysis_Plugin with MacOS and QGIS 3.16 #61

@dbrosi

Description

@dbrosi

Hi Everyone!

I am a very beginner coder and I am trying to install the HotSpot Analysis Plugin. I seem to be having some trouble beyond installing the correct pysal version and think it might be based on the pathname where QGIS is trying to call the python/pysal package. I went through all the steps posted on how to get the 1.4.3 version of pysal, but still with the same warning message from QGIS. Here is what my terminal says when I check what version of pysal I have:

Name: PySAL
Version: 1.14.3
Summary: A library of spatial analysis functions.
Home-page: http://pysal.org
Author: None
Author-email: None
License: BSD
Location: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages
Requires: scipy, numpy
Required-by:

I even tried uploading the pysal file to the folder path that QGIS uses, but then just started hitting roadblocks of it not encountering other "modules" in that folder.

I am wondering if someone can help me figure out how to get QGIS to read the right pysal location for macOS? In terminal it says that the pysal package is located under /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages and my QGIS is mapping to /Applications/QGIS.app/Contents/Resources/python. I looked at other forums where they talk about code to change the PYTHONPATH - but none of them worked and I always ended up with error messages in either terminal or QGIS console.

Just for reference here is the error message I get and why I think that it is a problem with the pathname.

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

ModuleNotFoundError: No module named 'pysal.esda'
Traceback (most recent call last):
File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 334, in _startPlugin
plugins[packageName] = package.classFactory(iface)
File "/Users/deenabrosi/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/HotspotAnalysis/init.py", line 34, in classFactory
from .hotspot_analysis import HotspotAnalysis
File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 792, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/deenabrosi/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/HotspotAnalysis/hotspot_analysis.py", line 39, in
from pysal.esda.getisord import *
File "/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 792, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'pysal.esda'

Python version: 3.8.7 (default, Feb 10 2021, 09:04:08) [Clang 12.0.0 (clang-1200.0.32.29)]
QGIS version: 3.16.4-Hannover Hannover, 81ba6c0826

Python Path:
/Applications/QGIS-LTR.app/Contents/MacOS/../Resources/python

Any help is very much appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions