安装 Tensorflow 时权限被拒绝 [英] Permission denied when installing Tensorflow

查看:99
本文介绍了安装 Tensorflow 时权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过 Anaconda 安装 TensorFlow(我的 Python 是 3.5.2 版).

I am trying to install TensorFlow by Anaconda(My Python is 3.5.2 edition).

当我跑步时:

(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl 

根据 Tensorflow.org 中的指南,出现以下提示:

According to the guide in Tensorflow.org, the following tips emerge:

Exception:
Traceback (most recent call last):
File "C:\Users\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
File "C:\Users\Anaconda3\lib\site-packages\pip\commands\install.py", line 317, in run
prefix=options.prefix_path,
File "C:Anaconda3\lib\site-packages\pip\req\req_set.py", line 742, in install
**kwargs
File "C:\Users\Anaconda3\lib\site-packages\pip\req\req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Users\Anaconda3\lib\site-packages\pip\req\req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "C:\Users\Anaconda3\lib\site-packages\pip\wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "C:\Users\Anaconda3\lib\site-packages\pip\wheel.py", line 324, in clobber
shutil.copyfile(srcfile, destfile)
File "C:\Users\Anaconda3\lib\shutil.py", line 115, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Anaconda3\\Lib\\site-packages\\numpy\\core\\multiarray.cp35-win_amd64.pyd'

我不知道是什么导致了这个错误.有人可以帮我吗?

I don't know what causes this error. Can someone help me with that?

推荐答案

可能会迟到但我得到了完全相同的错误,这就是发生的事情.我的问题是在 numpy 中使用了一些文件,该文件被 anaconda(或其他一些进程)锁定,我猜并且 tensorflow 需要该文件.因此,我的许可被拒绝.我所做的就是关闭每个进程 anaconda、jupyter 等并运行:

Might be late but I got the exact same error and this is what happened. My issue was that there was some file that was being used inside numpy that was locked by anaconda(or some other process) I guess and tensorflow needed that file. Hence I got permission denied. All I did was shut down every process anaconda, jupyter etc and ran:

1) conda update --all
2) pip install --ignore-installed tensorflow

以管理员身份打开你的cmd,不要激活tensorflow.只需从您的 cmd 发出命令即可.例如:C:\\>pip install --ignore-installed tensorflow (您的目录可能会有所不同)应该没问题.如果您遇到困难,请告诉我.

Open your cmd as an administrator and do not activate tensorflow. Just simply fire commands from your cmd. For eg: C:\\> pip install --ignore-installed tensorflow (your directory may vary) should be fine. Let me know if you get stuck.

这篇关于安装 Tensorflow 时权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆