【发布时间】:2016-08-04 14:26:32
【问题描述】:
我尝试为 Python 3 安装 scikit-learn。我通过以下方式进行安装:
virtualenv model_env
source model_env/bin/activate
pip3 install sklearn
因此,我收到以下错误消息:
Downloading/unpacking sklearn
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement sklearn
Cleaning up...
No distributions at all found for sklearn
pandas 包我遇到了同样的问题,我已经使用以下命令解决了它:
sudo apt-get install python3-pandas
不幸的是,同样的方法不适用于sklearn
sudo apt-get install python3-sklearn
添加
当我将sklearn 替换为scikit-learn 时,我遇到了同样的问题:
Downloading/unpacking scikit-learn
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement scikit-learn
Cleaning up...
No distributions at all found for scikit-learn
增加了 2 个
正如推荐的那样,我尝试将 pip 与-vvv 结合使用。请注意,我使用pip3 而不是pip。这是我得到的结果:
Downloading/unpacking scikit-learn
Getting page https://pypi.python.org/simple/scikit-learn/
Could not fetch URL https://pypi.python.org/simple/scikit-learn/: connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/scikit-learn/ (Caused by <class 'OSError'>: [Errno 101] Network is unreachable)
Will skip URL https://pypi.python.org/simple/scikit-learn/ when looking for download links for scikit-learn
Getting page https://pypi.python.org/simple/
Could not fetch URL https://pypi.python.org/simple/: connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/ (Caused by <class 'OSError'>: [Errno 101] Network is unreachable)
Will skip URL https://pypi.python.org/simple/ when looking for download links for scikit-learn
Cannot fetch index base URL https://pypi.python.org/simple/
URLs to search for versions for scikit-learn:
* https://pypi.python.org/simple/scikit-learn/
Getting page https://pypi.python.org/simple/scikit-learn/
Could not fetch URL https://pypi.python.org/simple/scikit-learn/: connection error: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/scikit-learn/ (Caused by <class 'OSError'>: [Errno 101] Network is unreachable)
Will skip URL https://pypi.python.org/simple/scikit-learn/ when looking for download links for scikit-learn
Could not find any downloads that satisfy the requirement scikit-learn
Cleaning up...
Removing temporary dir /tmp/pip_build_root...
No distributions at all found for scikit-learn
Exception information:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python3/dist-packages/pip/req.py", line 1178, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 277, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
pip.exceptions.DistributionNotFound: No distributions at all found for scikit-learn
Storing debug log for failure in /home/rngorb/.pip/pip.log
【问题讨论】:
-
sudo pip install -U pip sudo pip install -U scikit-learn
-
包名是 scikit-learn
-
@Luca,
scikit-learn也不能正常工作(请参阅我的问题的更新)。 -
听起来 pip 在 pypi 上找不到任何东西...尝试运行
sudo pip -vvv install scikit-learn以获取更多诊断信息。 -
要检查网络,您可以尝试 ping pypi.python.org。如果这不起作用,您需要查看您的网络配置。
标签: python scikit-learn python-3.4