pip install

来源:互联网 发布:广州多迪网络靠谱吗 编辑:程序博客网 时间:2024/06/05 04:01

当运行Anaconda,安装sklearn的的时候出现这个错误:

  • Windows 10
  • Python 3.6.0
  • Anaconda
出现的错误如下:

Exception:Traceback (most recent call last):  File "d:\anaconda3\lib\site-packages\pip\basecommand.py", line 209, in main    status = self.run(options, args)  File "d:\anaconda3\lib\site-packages\pip\commands\install.py", line 317, in run    prefix=options.prefix_path,  File "d:\anaconda3\lib\site-packages\pip\req\req_set.py", line 732, in install    **kwargs  File "d:\anaconda3\lib\site-packages\pip\req\req_install.py", line 835, in install    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)  File "d:\anaconda3\lib\site-packages\pip\req\req_install.py", line 1030, in move_wheel_files    isolated=self.isolated,  File "d:\anaconda3\lib\site-packages\pip\wheel.py", line 344, in move_wheel_files    clobber(source, lib_dir, True)  File "d:\anaconda3\lib\site-packages\pip\wheel.py", line 322, in clobber    shutil.copyfile(srcfile, destfile)  File "d:\anaconda3\lib\shutil.py", line 115, in copyfile    with open(dst, 'wb') as fdst:PermissionError: [Errno 13] Permission denied: 'd:\\anaconda3\\Lib\\site-packages\\sklearn\\utils\\murmurhash.cp35-win_amd64.pyd'


解决方法:以管理员的身份运行:    Anaconda Prompt


在这个问题解除了之后又出现了新的问题,当我试着创建一个新的python时,

conda create --name py36 python=3.6

又开始报错了:

CondaHTTPError: HTTP None Nonefor url <None>An HTTP error occurred when trying to retrieve this URL.ConnectionError(MaxRetryError('HTTPSConnectionPool(host=\'repo.continuum.io\', port=443): Max retries exceeded with url: /pkgs/free/win-64/repodata.json.bz2 (Caused by ReadTimeoutError("HTTPSConnectionPool(host=\'repo.continuum.io\', port=443): Read timed out. (read timeout=6.1)",))',),)
出错的原因可能是由于国内的网络连接国外的库的问题,这种问题可能会随着某些重大事件的出现而出现。

更改的方式是使用清华大学的镜像作为默认的库来更新,在Prompt下写如下代码:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/


然后使用conda config --show语句查看配置信息,会发现:



里面多了一个默认项。

然后再更新包就会很快了。


后记:

假如上面两部做完之后还是报第二个问题的错,那么就去看看你的防火墙设置吧。

     建议将防火墙关闭试试看。



参考文章:http://www.jianshu.com/p/2f3be7781451


原创粉丝点击