尝试安装tensorflow时收到奇怪的权限错误

时间:2017-03-27 02:21:14

标签: python linux permissions tensorflow anaconda

如果这是微不足道,我道歉。我对在Linux中运行命令感到不太舒服,所以我在调试下面的问题时遇到了麻烦。我只是按照安装过程here.

(tensorflow) MAdhavs-MBP:~ madhavthaker$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.1-py2-none-any.whl
Collecting tensorflow==1.0.1 from https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.1-py2-none-any.whl
  Downloading https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.1-py2-none-any.whl (39.3MB)
    100% |████████████████████████████████| 39.3MB 15kB/s 
Collecting mock>=2.0.0 (from tensorflow==1.0.1)
  Using cached mock-2.0.0-py2.py3-none-any.whl
Collecting six>=1.10.0 (from tensorflow==1.0.1)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting numpy>=1.11.0 (from tensorflow==1.0.1)
  Using cached numpy-1.12.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting protobuf>=3.1.0 (from tensorflow==1.0.1)
  Using cached protobuf-3.2.0-py2.py3-none-any.whl
Collecting wheel (from tensorflow==1.0.1)
  Using cached wheel-0.29.0-py2.py3-none-any.whl
Collecting funcsigs>=1; python_version < "3.3" (from mock>=2.0.0->tensorflow==1.0.1)
  Using cached funcsigs-1.0.2-py2.py3-none-any.whl
Collecting pbr>=0.11 (from mock>=2.0.0->tensorflow==1.0.1)
  Using cached pbr-2.0.0-py2.py3-none-any.whl
Collecting setuptools (from protobuf>=3.1.0->tensorflow==1.0.1)
  Using cached setuptools-34.3.3-py2.py3-none-any.whl
Collecting appdirs>=1.4.0 (from setuptools->protobuf>=3.1.0->tensorflow==1.0.1)
  Using cached appdirs-1.4.3-py2.py3-none-any.whl
Collecting packaging>=16.8 (from setuptools->protobuf>=3.1.0->tensorflow==1.0.1)
  Using cached packaging-16.8-py2.py3-none-any.whl
Collecting pyparsing (from packaging>=16.8->setuptools->protobuf>=3.1.0->tensorflow==1.0.1)
  Using cached pyparsing-2.2.0-py2.py3-none-any.whl
Installing collected packages: funcsigs, six, pbr, mock, numpy, appdirs, pyparsing, packaging, setuptools, protobuf, wheel, tensorflow
Exception:
Traceback (most recent call last):
  File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/pbr/__init__.py'
(tensorflow) MAdhavs-MBP:~ madhavthaker$ 

这对我来说毫无意义,因为我是我Mac上的唯一用户。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:3)

您似乎没有使用适当的权限。

尝试sudo pip install