我已关注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)]
我使用以下两个命令来安装tensorflow
** 1。 sudo pip install --upgrade $ TF_BINARY_URL
不知怎的,我发现Protobuf没有安装在我的Python 2.7下, 所以我按照安装网站的建议,
无法安装protobuf,请参阅下面的错误消息。
请帮忙
使用第一个命令时,收到以下消息:
目录' / Users / David / Library / Caches / pip / http'或其父目录不归当前用户所有,并且已禁用缓存。请检查该目录的权限和所有者。如果用sudo执行pip,你可能需要sudo的-H标志。 目录' / Users / David / Library / Caches / pip'或其父目录不归当前用户所有,并且已禁用缓存轮。检查该目录的权限和所有者。如果用sudo执行pip,你可能需要sudo' -H标志。
然后按照建议,我使用了第二个命令,然后错误消息是:
例外: Traceback(最近一次调用最后一次): 文件" /Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/basecommand.py" ;,第215行,主要 status = self.run(options,args) 文件" /Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/commands/install.py" ;,第317行,在运行中 PREFIX = 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 =真) 文件" /Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_install.py" ;,第742行,在卸载中 paths_to_remove.remove(auto_confirm) File" /Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_uninstall.py" ;,第115行,删除 重命名(path,new_path) File" /Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/utils/ init .py",第267行,in重命名 shutil.move(旧的,新的) File" /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py" ;,第299行,移动 copytree(src,real_dst,symlinks = True) 文件" /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py" ;,第208行,在copytree中 提出错误,错误 错误:[(' /System/Library/Frameworks/Python.framework/Versions/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]不允许操作:' /tmp/pip-9CKE1y-uninstall/System/Library/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&#39 ;,' /tmp/pip-9CKE1y-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ init .pyc' ," [Errno 1]不允许操作:' /tmp/pip-9CKE1y-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ init .pyc'"),(' /System/Library/Frameworks/Python.framework/Versions/2.7/ Extras / lib / python / _markerlib / markers.py',' /tmp/pip-9CKE1y-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/ markers.py'," [Errno 1]不允许操作:' /tmp/pip-9CKE1y-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/ python / _markerlib / markers.py'"),(' /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc' ,' /tmp/pip-9CKE1y-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc' ;," [Errno 1 ]不允许操作:' /tmp/pip-9CKE1y-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'" ),(' /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib' ;,' / tmp / pip-9CKE1y-uninstall / System / Library /框架/ Python.framework /版本/ 2.7 /附加/ LIB /蟒/ _markerlib' ," [Errno 1]不允许操作:' /tmp/pip-9CKE1y-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib' &#34)]
对于推荐3,错误消息:
命令" / usr / bin / python -u -c"导入setuptools,tokenize; 文件 =' / private / var / folders / h5 / vh7y894j0js3vqkv_hz4qk6w0000gn /T/pip-build-KWqDAq/protobuf/setup.py';exec(compile(getattr(tokenize,' open',open)( file )。read( ).replace(' \ r \ n',' \ n'),文件,' exec'))" install --record /var/folders/h5/vh7y894j0js3vqkv_hz4qk6w0000gn/T/pip-5RoEnu-record/install-record.txt --single-version-external-managed --compile"在/ private / var / folders / h5 / vh7y894j0js3vqkv_hz4qk6w0000gn / T / pip-build-KWqDAq / protobuf /
中出现错误代码1失败答案 0 :(得分: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)
答案 1 :(得分:0)
安装awsebcli时遇到了类似的问题,
尝试:
sudo pip install protobuf --ignore-installed six