在Ubuntu 16.04上安装TensorFlow时出错?

时间:2017-01-22 09:31:21

标签: python tensorflow ubuntu-16.04

我运行**PermissionError: [Errno 13]** Permission denied: '/usr/local/lib/python3.5/dist-packages/protobuf-3.1.0.post1-py2.7-nspkg.pth时收到错误pip install tensorflow-gpu

pip install tensorflow-gpu
Collecting tensorflow-gpu
Using cached tensorflow_gpu-0.12.1-cp35-cp35m-manylinux1_x86_64.whl
Requirement already satisfied: numpy>=1.11.0 in ./.local/lib/python3.5/site-packages (from tensorflow-gpu)
Collecting protobuf>=3.1.0 (from tensorflow-gpu)
Using cached protobuf-3.1.0.post1-py2.py3-none-any.whl
Requirement already satisfied: six>=1.10.0 in /usr/lib/python3/dist-packages (from tensorflow-gpu)
Requirement already satisfied: wheel>=0.26 in /usr/lib/python3/dist-packages (from tensorflow-gpu)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from protobuf>=3.1.0->tensorflow-gpu)
Installing collected packages: protobuf, tensorflow-gpu
Exception:
Traceback (most recent call last):
File "/home/amanckc/.local/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
File "/home/amanckc/.local/lib/python3.5/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
File "/home/amanckc/.local/lib/python3.5/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
File "/home/amanckc/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/amanckc/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
File "/home/amanckc/.local/lib/python3.5/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
File "/home/amanckc/.local/lib/python3.5/site-packages/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
File "/usr/lib/python3.5/shutil.py", line 115, in copyfile
    with open(dst, 'wb') as fdst:
**PermissionError: [Errno 13]** Permission denied: '/usr/local/lib/python3.5/dist-packages/protobuf-3.1.0.post1-py2.7-nspkg.pth'

1 个答案:

答案 0 :(得分:0)

您应该依赖命令但--user喜欢:

pip install --user tensorflow-gpu

请改进问题的设计!