If you’re seeing the error ModuleNotFoundError: No module named 'GeoPublicHealth', you have an old cached version of the plugin installed.
The uninstaller might not remove all files. Delete the plugin directory manually:
On macOS:
rm -rf ~/Library/Application\ Support/QGIS/QGIS3/profiles/default/python/plugins/geopublichealth
On Windows:
rmdir /s /q "%APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\geopublichealth"
On Linux:
rm -rf ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/geopublichealth
On macOS:
rm -rf ~/Library/Application\ Support/QGIS/QGIS3/profiles/default/cache
On Windows:
rmdir /s /q "%APPDATA%\QGIS\QGIS3\profiles\default\cache"
On Linux:
rm -rf ~/.local/share/QGIS/QGIS3/profiles/default/cache
The plugin should now install correctly with the updated code!
After installation, check that the plugin loaded successfully:
After reinstalling the plugin, you’ll need to install the required Python dependencies.
These are required for spatial autocorrelation and analysis features.
Using QGIS Python Console:
import subprocess, sys
subprocess.run([sys.executable, "-m", "pip", "install", "numpy"])
subprocess.run([sys.executable, "-m", "pip", "install", "scipy"])
subprocess.run([sys.executable, "-m", "pip", "install", "pandas"])
subprocess.run([sys.executable, "-m", "pip", "install", "libpysal", "esda", "--no-build-isolation"])
subprocess.run([sys.executable, "-m", "pip", "install", "numba"])
import libpysal, esda
print(f"libpysal {libpysal.__version__}, esda {esda.__version__} installed!")
Important: Do NOT paste multiple lines at once. Run each command separately.
matplotlib is optional but enables graphing and plotting features. To install it:
import subprocess, sys
subprocess.run([sys.executable, "-m", "pip", "install", "matplotlib"])
import matplotlib
print(f"matplotlib {matplotlib.__version__} installed!")
Important: Do NOT paste multiple lines at once. Run each command separately or you’ll get a SyntaxError.
install_matplotlib_in_qgis.py from the repositoryIf you’re still experiencing problems:
ls -la ~/Library/Application\ Support/QGIS/QGIS3/profiles/default/python/plugins/geopublichealth/
__init__.py file contains: from geopublichealth.src.plugin import GeoPublicHealthPlugintry:
import matplotlib
print(f"matplotlib {matplotlib.__version__} is installed")
except ImportError:
print("matplotlib is not installed (optional for plotting)")
If you’re developing or testing locally, make sure to:
geopublichealth in all importsgeopublichealth (lowercase)