Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try to downgrade the sklearn version and rise a strange error #19689

Closed
billMuxing opened this issue Mar 16, 2021 · 4 comments
Closed

try to downgrade the sklearn version and rise a strange error #19689

billMuxing opened this issue Mar 16, 2021 · 4 comments

Comments

@billMuxing
Copy link

                    ***

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

- If your compiler supports OpenMP but the build still fails, please
  submit a bug report at:

    https://github.com/scikit-learn/scikit-learn/issues

- If you want to build scikit-learn without OpenMP support, you can set
  the environment variable SKLEARN_NO_OPENMP and rerun the build
  command. Note however that some estimators will run in sequential
  mode and their `n_jobs` parameter will have no effect anymore.

                    ***

my currently scikit-learn version is 0.24.1
I want to downgrade the version to 0.21.3 by using
pip install scikit-learn==0.21.3
and the error was rise to me
and I try all the method that I find in google
still can not fix it
dose anyone know how to fix it?

@NicolasHug
Copy link
Member

and I try all the method that I find in google
still can not fix it

Sorry to ask but have you tried the suggestions in the error message above? If you have, please report the issues you found. In particular for

export SKLEARN_NO_OPENMP=1
pip install scikit-learn==0.21.3

Also why do you need 0.21, and what arch are you building on?

@billMuxing
Copy link
Author

billMuxing commented Mar 16, 2021

I try your suggestion
it didn't raise previous problem anymore but it raise another error
which is

Rolling back uninstall of scikit-learn
  Moving to /Users/muxingli/opt/miniconda3/lib/python3.8/site-packages/scikit_learn-0.24.1.dist-info/
   from /Users/muxingli/opt/miniconda3/lib/python3.8/site-packages/~cikit_learn-0.24.1.dist-info
  Moving to /Users/muxingli/opt/miniconda3/lib/python3.8/site-packages/sklearn/
   from /Users/muxingli/opt/miniconda3/lib/python3.8/site-packages/~klearn
ERROR: Command errored out with exit status 1: /Users/muxingli/opt/miniconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/vd/jhc7w4b569v6sjl97vxnh4ph0000gn/T/pip-install-diwjchzt/scikit-learn/setup.py'"'"'; __file__='"'"'/private/var/folders/vd/jhc7w4b569v6sjl97vxnh4ph0000gn/T/pip-install-diwjchzt/scikit-learn/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/vd/jhc7w4b569v6sjl97vxnh4ph0000gn/T/pip-record-3nxplv2o/install-record.txt --single-version-externally-managed --compile --install-headers /Users/muxingli/opt/miniconda3/include/python3.8/scikit-learn Check the logs for full command output. 

before that there is a lot of red warning and error

sorry for throw another error again

and the reason I want to use 0.21.3 is because I want to run a project code called Plasclass
it need to use module 'sklearn.linear_model.logistic'
and 0.24.1 will throw a model can't find error
ModuleNotFoundError: No module named 'sklearn.linear_model.logistic'

@lesteve
Copy link
Member

lesteve commented Mar 17, 2021

I think it is unlikely that this is a problem with scikit-learn. I feel this is more a general "how do I get out of weird issues when installing something with Python" question or maybe an installation question for https://github.com/Shamir-Lab/PlasClass (it that is the PlasClass package you are trying to use).

As a general recommendation it is a very bad idea to mix conda and pip for the same package. This can happen without realising, e.g. conda install scikit-learn + pip install PassClass will replace a conda-installed scikit-learn with a pip-installed one and weird things can happen. This is because PassClass insists on very specific version of scikit-learn (also numpy and scipy) in its setup.py.

I would first try to create a separate conda environment and see whether the issue is still there. This is what I would try (wild-guesses because it is hard to help you with very partial information):

First approach: the "conda for environments + full pip" way

Probably preferable here because PassClass insists on very specific version of scikit-learn (also numpy and scipy) in its setup.py.

conda create -n new-env python=3.8
conda activate new-env
pip install PlasClass

Alternative: the "conda for most packages + pip on top of it when you absolutely need it" way

conda create -n new-env python=3.8 scikit-learn=0.21.3
conda active new-env
pip install PlasClass

Misc

not sure why from your logs, pip is trying to build from source rather than use a wheel, maybe someone else will have a better idea about this ...

@lesteve
Copy link
Member

lesteve commented Mar 17, 2021

Migrating this to a discussion, which it should probably have been in the first place ...

@lesteve lesteve closed this as completed Mar 17, 2021
@scikit-learn scikit-learn locked and limited conversation to collaborators Mar 17, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants