首页 文章

使用pip在iMac El Capitan上安装张量流的问题?

提问于
浏览
0

我跟着the installation guide但最后的安装步骤失败了 . 我安装的python版本:python 2.7.10(默认,2015年10月23日,19:19:21)[GCC 4.2.1兼容Apple LLVM 7.0.0(clang-700.0.59.5)]在darwin

我使用以下两个命令来安装tensorflow

** 1 . sudo pip install --upgrade $ TF_BINARY_URL

  • sudo -H pip install --upgrade $ TF_BINARY_UR **

不知怎的,我发现Protobuf没有安装在我的Python 2.7下,所以我按照安装网站的建议,

  • pip install protobuf

它无法安装protobuf,请参阅下面的错误消息 .

请帮忙

提前致谢

When using the first command, got the following messages:

目录'/ Users / David / Library / Caches / pip / http'或其父目录不归当前用户所有,并且已禁用缓存 . 请检查该目录的权限和所有者 . 如果用sudo执行pip,你可能需要sudo的-H标志 . 目录'/ Users / David / Library / Caches / pip'或其父目录不归当前用户所有,并且已禁用缓存轮 . 检查该目录的权限和所有者 . 如果用sudo执行pip,你可能需要sudo的-H标志 .

Then as suggested, I used the second command, then error messages were:

异常:回溯(最近一次调用最后一次):文件"/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/basecommand.py",第215行,主状态= self.run(options,args)文件"/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/commands/install.py",第317行,在运行前缀= options.prefix_path,文件"/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_set.py",第736行,在安装中requirement.uninstall(auto_confirm = True)文件"/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_install.py",第742行,在uninstall paths_to_remove.remove(auto_confirm)文件"/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_uninstall.py",第115行,删除重命名(path,new_path)文件“/Library/Python/2.7/site-packages/pip -8.1.2-py2.7.egg / pip / utils / init .py ", line 267, in renames shutil.move(old, new) File " /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py ", line 299, in move copytree(src, real_dst, symlinks=True) File " / System / Library / Frameworks /Python.framework/Versions/2.7/lib/python2.7/shutil.py“,第208行,在copytree中引发错误,错误错误:[('/ System / Library / Frameworks / Python.framework / Version / 2.7 / Extras / lib / python / _markerlib / init .py ', ' /tmp/pip-9CKE1y-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ init .py ', "[Errno 1] Operation not permitted: ' / tmp / pip -9CKE1y-卸载/系统/ L ibrary / Frameworks / Python.framework / Versions / 2.7 / Extras / lib / python / _markerlib / init .py '"), (' /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ init .pyc ', ' /tmp/pip-9CKE1y-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ init .pyc ', "[Errno 1] Operation not permitted: ' / tmp / pip-9CKE1y-uninstall / System / Library / Frameworks /Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ init .pyc ' 1050633 [Errno 1] Operation not permitted: ' /tmp/pip-9CKE1y-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/ _markerlib / markers.py ' 1050634 [Errno 1] Operation not permitted: ' /tmp/pip-9CKE1y-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc ' 1050635 [Errno 1] Operation not permitted: ' / tmp / pip-9CKE1y-uninstall /系统/资源库/框架/ Python.framework /版本/ 2.7 /额外/ lib中/蟒蛇/ _markerlib'“)]

for the commend 3, the error message:

命令"/usr/bin/python -u -c " import setuptools,tokenize; file = '/private/var/folders/h5/vh7y894j0js3vqkv_hz4qk6w0000gn/T/pip-build-KWqDAq/protobuf/setup.py'; exec(编译(getattr(tokenize,'open',open)( file ) . read() . replace('\r\n','\n'), file ,'exec'))" install --record /var/folders/h5/vh7y894j0js3vqkv_hz4qk6w0000gn/T/pip-5RoEnu-record/install-record.txt --single-version-externally-managed --compile"失败,错误代码为1 / private / var / folders / H5 / vh7y894j0js3vqkv_hz4qk6w0000gn / T / PIP-积聚KWqDAq / protobuf的/

2 回答

  • 0

    我认为这是El Capitan的System Integrity Protection的结果 . 我能够使用以下安装:

    # Note the lack of "sudo" and the addition of "--user"
    pip install --user --upgrade $TF_BINARY_URL
    # And then to ensure that the user-specific packages are used,
    # I had to start python from the user-site packages directory
    cd $(python -m site --user-site)
    
  • 0

    我在安装awsebcli时遇到了类似的问题,

    尝试:

    sudo pip install protobuf --ignore-installed six
    

相关问题