환경 세팅 및 에러 해결

Python: No module named 'sklearn.__check_build._check_build'

jiwoolee 2021. 9. 28. 10:42

ModuleNotFoundError: No module named 'sklearn.__check_build._check_build'

ImportError: No module named 'sklearn.__check_build._check_build'

 

1. It seems that scikit-learn has not been built correctly.
2. If you have installed scikit-learn from source, please do not forget to build the package before using it: run `python setup.py install` or `make` in the source directory.
3. If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.

 

 

 

 

 

 

차례로 확인해보자

 

 

1. It seems that scikit-learn has not been built correctly.

나의 경우 아래 버전을 사용중이다.

python 3.7.0

scikit-learn 0.24.1

tensorflow-gpu 1.14.0

 

 

anaconda cmd에서 확인을 해봐도 당연히 같다

제대로 설치가 됐다.

 

 

 

 

 

 

 

 

 

 

그럼 2번 방법을 사용해보자

2. If you have installed scikit-learn from source, please do not forget to build the package before using it:

run `python setup.py install` or `make` in the source directory.

 

이때 말하는 setup.py는

pip install로 사용하는 일반 사용자를 위한 최소 설치 요구사항이다.

 

나는 requirements.txt 로 사용했는데!

이건 개발자를 위한 설치 요구사항이라는 차이가 있다.

 

 

 

 

 

 

 

 

마지막으로 버전을 확인해보자

3. If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.

 

Scikit-learn 0.23 - 0.24 require Python 3.6 or newer.

 https://scikit-learn.org/stable/install.html

 

Installing scikit-learn

There are different ways to install scikit-learn: Install the latest official release. This is the best approach for most users. It will provide a stable version and pre-built packages are availabl...

scikit-learn.org

 

위에서 확인한 버전은 아래와 같다

python 3.7

scikit-learn 0.24.1

tensorflow-gpu 1.14.0

 

 

이 문제도 아니다....

 

 

 

 

 

 

 

그냥 충돌 문제일 수도 있다.

삭제 후 재설치가 가장 쉬운 방법

pip uninstall scikit-learn
pip install -U scikit-learn #필요한 버전으로 재설치

 

 

 

 

파이썬 파일이 정상적으로 실행된다

 

 

 

 

 

 

 

** 하라는 대로 하면 바로 되는 경우가 있어서 거기에 집착하느라 오히려 돌아간 거 같다