danioxoli / HotSpotAnalysis_Plugin

A QGIS plugin for hotspot analysis
GNU General Public License v3.0
55 stars 12 forks source link

ModuleNotFoundError: No module named 'shapes' #4

Closed vagvaf closed 6 years ago

vagvaf commented 6 years ago

Hello, I am trying to install the plugin in ubuntu 18.04 and qgis 3.0. but I am getting the following error:

ModuleNotFoundError: No module named 'shapes' 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 336, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/home/vagvaf/.local/share/QGIS/QGIS3/profiles/default/python/plugins/HotspotAnalysis/__init__.py", line 34, in classFactory
    from .hotspot_analysis import HotspotAnalysis
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/vagvaf/.local/share/QGIS/QGIS3/profiles/default/python/plugins/HotspotAnalysis/hotspot_analysis.py", line 38, in 
    import pysal
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/vagvaf/.local/lib/python3.6/site-packages/pysal/__init__.py", line 40, in 
    import pysal.cg
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/vagvaf/.local/lib/python3.6/site-packages/pysal/cg/__init__.py", line 4, in 
    from shapes import *
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'shapes'

I have all packages installed:

for python 2.7

Requirement already satisfied: pysal in /home/vagvaf/.local/lib/python2.7/site-packages
Requirement already satisfied: numpy>=1.3 in /home/vagvaf/.local/lib/python2.7/site-packages (from pysal)
Requirement already satisfied: scipy>=0.11 in /home/vagvaf/.local/lib/python2.7/site-packages (from pysal)

for python 3.6

Requirement already satisfied: pysal in /home/vagvaf/.local/lib/python3.6/site-packages
Requirement already satisfied: scipy>=0.11 in /home/vagvaf/.local/lib/python3.6/site-packages (from pysal)
Requirement already satisfied: numpy>=1.3 in /home/vagvaf/.local/lib/python3.6/site-packages (from pysal)

Any help would be appreciated!

danioxoli commented 6 years ago

Dear Vagvaf,

Did you install PySAL using the "pip3" command or "apt-get install python3-pysal"?

If I remember correctly, I have faced the similar issue at the first test on Ubuntu 18 with Python 3 and PySAL (v 1.13). If you do not specify the Python version when installing this may cause problems.

Let me know if this was useful

Daniele

vagvaf commented 6 years ago

I finally fixed it. Thank you for your suggestions. I installed pysal using pip3 and then also downgraded scipy-1.0.1 to scipy-0.19.1 because i was getting another type of error related to :https://issues.qgis.org/issues/16790