4

I am using MacOs Mojave and currently trying to run the project available on GitHub on this link. I have installed latest version of python(i.e. python 3.8) and currently facing issues while installing the requirements, mainly in scikit-learn. Either way I am getting the same error.

Kindly help me through out to run this project completely on my machine locally.

enter image description here

I've also raised an issue on the main GitHub page regarding this and still waiting for an adequate response.

When I tried to install cython according to the given instructions and available answer on stackoverflow I'm getting another big error page with python3.8 using command- pip3 install --upgrade cython as mentioned in an answer. I'm attaching that's error messages here. enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here This is the complete set of error that I'm getting after that. Thanks in advance if anyone can get me through this project with python3.8

Thanks VonC for resolving the installation of cython. Now another error that I'm getting while installing scikit-learn with python3.8 in my system is: scikit-learn installation error with python3.8 As answered by @VonC, I did tried to follow linkenter link description here and now while executing the command pip install --verbose --editable . I'm now getting another error here Please help me regarding this. I've installed LLVM OpenMP library using Homebrew

1
  • I've edited my question after the first answer, forgot to mention that. Commented Nov 14, 2019 at 7:18

2 Answers 2

4

"no module named Cython" was seen in other projects: CellProfiler/centrosome issue 78 with various workarounds:

python3 setup.py install
# and/or
python3.6 -m pip install --upgrade cython
sudo python3.6 -m pip install --upgrade cython
# and/or
pip install --upgrade cython

If you're using python 2.7 or above, type on terminal: pip install --upgrade cython
This should work.
The error is probably because the cython version installed from pip is incompatible to the python version on your system.

If that leads to:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)

Then check this question, and try and update XCode: xcode-select --install


Regarding the scikit-learn error, it is:

It seems that scikit-learn cannot be built with OpenMP support.

  • Make sure you have followed the installation instructions:

https://scikit-learn.org/dev/developers/advanced_installation.html

There is an issue about this error

Looks like it's the result of an error in sklearn/_build_utils/openmp_helpers.py
For me the test program ./test_openmp.c works as expected, but not in the building Scikit-learn process.

So, I just replace False to True in the line 111 in openmp_helpers.py (sed -i -e '111s/False/True/' e.g.).
As a result, I get normal building of Scikit-learn 0.21.3

But also, from instructions for Mac:

install libomp with Homebrew to extend the default Apple clang compiler.

I tried the second option to install libomp with Homebrew.
It worked like a charm.

If you see "File "setup.py" not found", that means the pip command was not executed in the correct folder.
If you are installing from sources, you should type the pip install --verbose --editable . (after a conda activate sklearn-dev) where you have cloned said sources (where you should see a setup.py)

Sign up to request clarification or add additional context in comments.

23 Comments

but pip3 install --upgrade cython generates another error here.
although it is working for python 2.7 but not for python 3.8. I've the project which is giving error when I'm trying to run it using python 3.8 and when I'm trying to run it over with python 2.7 it is giving a file error like .....(cfd_apriori) Mac:web kyvinay$ python manage.py runserver File "manage.py", line 14 ) from exc
Can you suggest something regarding that? If you can look out for the original project on GitHub please check that out and then the instructions would be better understandable for me. The whole project has been run over another old python version and now it's giving me headaches with python 3.8
@vinay First, I suspect your project is mainly compatible with Python 3.x, not the old obsolete python 2. So errors are expected with Python 2.
@vinay Then, what is the error your have with an up-to-date pip3 (make sure to upgrare pip) and pip3 install --upgrade cython?
|
0

You just need to first install scikit-learn. Use:

pip install -U scikit-learn

OR

pip3 install -U scikit-learn

1 Comment

I did tried to install scikit-learn but I'm getting another error here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.