dzetsaka icon indicating copy to clipboard operation
dzetsaka copied to clipboard

Add macOS instructions to readme

Open jsparedes opened this issue 3 years ago • 1 comments

There is no instruction available for macOS.

There is a pending pull request from #25 (tested with macOS 10.13.6 (High Sierra) and 10.15.5 (Catalina), QGIS 3.10.) Also, there is an open issue #10 but related to qgis2.

jsparedes avatar Apr 25 '21 17:04 jsparedes

Maybe this could help someone with these configuration:

  • Operative System version: macOS Big Sur 11.2.3

  • QGIS: 3.16.5-Hannover

The short answer:

In our computer console:

python_qgis_path -m pip install -U pip

python_qgis_path -m pip install -U scikit-learn

Where python_qgis_path is the python used in QGIS. In my case python_qgis_path is /Applications/QGIS-LTR.app/Contents/MacOS/QGIS/bin

A detailed answer

The python_qgis_path can be deduced from the Python Console from QGIS:

import sys
print(sys.executable)
image

In my case:

  • The print message is /Applications/QGIS-LTR.app/Contents/MacOS/QGIS
  • And the python_qgis_path is /Applications/QGIS-LTR.app/Contents/MacOS/bin/python3

When I run the python_qgis_path in my computer console, I get: image

In my computer, when I tried python_qgis_path -m pip install -U scikit-learn i got an error with the Numpy dependency. Update the pip version is a way to handle this.

For this, reason I executed:

/Applications/QGIS-LTR.app/Contents/MacOS/QGIS/bin -m pip install -U pip

/Applications/QGIS-LTR.app/Contents/MacOS/QGIS/bin -m pip install -U --ignore-installed scikit-learn

Due my previous attempt with scikit-learn, I had to add the flag --ignore-installed

jsparedes avatar Apr 25 '21 19:04 jsparedes