해결 ERROR: no matching distribution found for scikit-learn

6319 단어
python 프로그램을 실행할 때 문제가 발생했습니다.
ImportError: No module named sklearn.cluster

간단하게 패키지를 설치하면 될 줄 알았는데 다음과 같이 실행합니다.
pip install scikit-learn

결과적으로 오류가 발생했습니다.
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.python.org/simple
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/scikit-learn/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/scikit-learn/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/scikit-learn/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/scikit-learn/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/scikit-learn/
ERROR: Could not find a version that satisfies the requirement scikit-learn (from versions: none)
ERROR: No matching distribution found for scikit-learn

근거https://blog.csdn.net/aiqinchao/article/details/89522180힌트를 국내 소스로 바꿔도 안 돼요.
이때 약간 어리둥절해서 지금까지 이 문제가 발생한 적이 없어서 apt-get 설치를 시험해 보았다.
sudo apt-get install python-sklearn

결과도 틀렸습니다. apt-get을 업그레이드해 달라고 했습니다. 저는 또 sudo apt-get update를 실행했는데 결과는 안 됐어요.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  python-joblib python-simplejson python-sklearn-lib
Suggested packages:
  python-dap python-scikits-optimization python-sklearn-doc ipython
The following NEW packages will be installed:
  python-joblib python-simplejson python-sklearn python-sklearn-lib
0 upgraded, 4 newly installed, 0 to remove and 90 not upgraded.
Need to get 2,368 kB of archives.
After this operation, 11.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Ign:1 http://mirrors.aliyun.com/ubuntu xenial/universe i386 python-joblib all 0.9.4-1
Err:2 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 python-simplejson amd64 3.8.1-1ubuntu2
  Temporary failure resolving 'mirrors.aliyun.com'
Ign:3 http://cn.archive.ubuntu.com/ubuntu xenial/universe amd64 python-sklearn-lib amd64 0.17.0-4
Ign:4 http://mirrors.aliyun.com/ubuntu xenial/universe i386 python-sklearn all 0.17.0-4
Err:2 http://cn.archive.ubuntu.com/ubuntu xenial/main amd64 python-simplejson amd64 3.8.1-1ubuntu2
  Temporary failure resolving 'mirrors.aliyun.com'
Err:3 http://cn.archive.ubuntu.com/ubuntu xenial/universe amd64 python-sklearn-lib amd64 0.17.0-4
  Temporary failure resolving 'mirrors.aliyun.com'
Err:1 http://cn.archive.ubuntu.com/ubuntu xenial/universe amd64 python-joblib all 0.9.4-1
  Temporary failure resolving 'mirrors.aliyun.com'
Err:1 http://cn.archive.ubuntu.com/ubuntu xenial/universe i386 python-joblib all 0.9.4-1
  Temporary failure resolving 'mirrors.aliyun.com'
Ign:4 http://cn.archive.ubuntu.com/ubuntu xenial/universe amd64 python-sklearn all 0.17.0-4
Err:1 http://cn.archive.ubuntu.com/ubuntu xenial/universe i386 python-joblib all 0.9.4-1
  Temporary failure resolving 'mirrors.aliyun.com'
Err:4 http://cn.archive.ubuntu.com/ubuntu xenial/universe i386 python-sklearn all 0.17.0-4
  Temporary failure resolving 'mirrors.aliyun.com'
Err:4 http://cn.archive.ubuntu.com/ubuntu xenial/universe i386 python-sklearn all 0.17.0-4
  Temporary failure resolving 'mirrors.aliyun.com'
E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/j/joblib/python-joblib_0.9.4-1_all.deb  Temporary failure resolving 'mirrors.aliyun.com'

E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/s/simplejson/python-simplejson_3.8.1-1ubuntu2_amd64.deb  Temporary failure resolving 'mirrors.aliyun.com'

E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/s/scikit-learn/python-sklearn-lib_0.17.0-4_amd64.deb  Temporary failure resolving 'mirrors.aliyun.com'

E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/s/scikit-learn/python-sklearn_0.17.0-4_all.deb  Temporary failure resolving 'mirrors.aliyun.com'

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

어쩔 수 없을 때 블로그를 찾았어요.https://blog.csdn.net/aiqinchao/article/details/89522180DNS에 문제가 생겼다고 합니다. 저는 인터넷을 한 적이 없습니다. DNS에 문제가 있을 수 있습니다. 죽은 말을 산 말로 삼는 태도로 DNS를 수정했습니다. 결과는 저를 놀라게 했습니다. 모든 것이 원래대로 돌아왔습니다. pip install xxx, apt-get update 모두 ok입니다. 여기서 블로거에게 감사드립니다. 다음은 수정 방법입니다.
1.'/etc/network/interfaces'파일을 열고, 없으면 하나를 만들고, 추가합니다.
dns-nameservers  223.5.5.5   223.6.6.6

2. 열기'/etc/resolv.conf 파일 및 두 줄 추가
nameserver  223..5.5.5 
nameserver  223.6.6.6

좋은 웹페이지 즐겨찾기