您的位置:首页 > 理论基础 > 计算机网络

pip install - PermissionError: [Errno 13] Permission denied

2017-07-24 10:26 726 查看
当运行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\\m
urmurhash.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\', p
ort=443): Max retries exceeded with url: /pkgs/free/win-64/repodata.json.bz2 (Ca
used by ReadTimeoutError("HTTPSConnectionPool(host=\'repo.continuum.io\', port=4
43): Read timed out. (read timeout=6.1)",))',),)
出错的原因可能是由于国内的网络连接国外的库的问题,这种问题可能会随着某些重大事件的出现而出现。

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

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/[/code] 
然后使用conda config --show语句查看配置信息,会发现:



里面多了一个默认项。

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

后记:

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

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

参考文章:http://www.jianshu.com/p/2f3be7781451
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐