1

I wanted to install LecoS plugin in Qgis. But first error appears that I have to instal scipy for python in orderd to use plugin.

Python was instaled using instructions from Qgis document, version 3.6.5. Qgis version 3.6.2.

  1. If i try to find the python in terminal :

$ python

Python 2.7.10 (default, Feb 22 2019, 21:17:52) [GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)] on darwin Type "help", "copyright", "credits" or "license" for more information.

$ which python

/usr/bin/python

$ pyhton3

Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information.

$ which python3

/Library/Frameworks/Python.framework/Versions/3.6/bin/python3

  1. and i already successfully installed all 3 using pip3

$ pip3 install numpy

Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages You are using pip version 9.0.3, however version 19.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

Julijas-Air:~ julijametic$ pip3 install scipy Collecting scipy Cache entry deserialization failed, entry ignored Using cached https://files.pythonhosted.org/packages/f4/b1/6e0c995d7646b12112a721e93dc6316409cc4827c10ee309747f45ea6bfd/scipy-1.2.1-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl Requirement already satisfied: numpy>=1.8.2 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from scipy) Installing collected packages: scipy Successfully installed scipy-1.2.1 You are using pip version 9.0.3, however version 19.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

Julijas-Air:~ julijametic$ pip3 install matplotlib Collecting matplotlib Cache entry deserialization failed, entry ignored Using cached https://files.pythonhosted.org/packages/82/7e/184d995d711e3401722769cd6982b46d42aee14a82ba54a3a79425f939c9/matplotlib-3.0.3-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib) Cache entry deserialization failed, entry ignored Using cached https://files.pythonhosted.org/packages/dd/d9/3ec19e966301a6e25769976999bd7bbe552016f0d32b577dc9d63d2e0c49/pyparsing-2.4.0-py2.py3-none-any.whl Requirement already satisfied: numpy>=1.10.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from matplotlib) Requirement already satisfied: python-dateutil>=2.1 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from matplotlib) Collecting kiwisolver>=1.0.1 (from matplotlib) Cache entry deserialization failed, entry ignored Using cached https://files.pythonhosted.org/packages/49/5d/d1726d2a2fd471a69ef5014ca42812e1ccb8a13085c42bfcb238a5611f39/kiwisolver-1.1.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl Collecting cycler>=0.10 (from matplotlib) Cache entry deserialization failed, entry ignored Using cached https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl Requirement already satisfied: six>=1.5 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from python-dateutil>=2.1->matplotlib) Requirement already satisfied: setuptools in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib) Installing collected packages: pyparsing, kiwisolver, cycler, matplotlib Successfully installed cycler-0.10.0 kiwisolver-1.1.0 matplotlib-3.0.3 pyparsing-2.4.0 You are using pip version 9.0.3, however version 19.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

  1. But then trying to import it:

$ import numpy

-bash: import: command not found

$ python3

Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information.

numpy Traceback (most recent call last): File "", line 1, in NameError: name 'numpy' is not defined

So I dont know if it works or not now?

After I went to try to install plugin again, but another error appears: Couldn't load plugin 'LecoS' due to an error when calling its classFactory() method Does it again have to do something with the python?

I am not a programmer, and have really small experience with QGis.

  • It seems that you've tried to import numpy in bash instead of the python shell. Type python3 first and then import numpy. – dmh126 May 2 at 21:27
  • $ python3 Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import numpy >>> import scipy >>> import matplotlib >>> – Julija M May 3 at 6:41
  • So this works now if no error appears? What about Couldn't load plugin 'LecoS' due to an error when calling its classFactory() method? – Julija M May 3 at 6:41
  • I manage to install PIL using pillow, and it looks like it worked. It installed the plugin without error. yey – Julija M May 3 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.