【问题标题】:How do I fix an exception caused by trying to install Tensorflow?如何修复因尝试安装 Tensorflow 而导致的异常?
【发布时间】:2016-11-26 04:21:27
【问题描述】:

所以我正在对 Tensorflow 进行 pip 安装,每次运行 sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl 时,都会收到这个令人讨厌的错误:

Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg/pip/req/req_set.py", line 726, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg/pip/req/req_install.py", line 746, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-8.1.1-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", line 208, in copytree
    raise Error, errors
Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', 
'/tmp/pip-OGQupl-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', 
"[Errno 1] Operation not permitted: '/tmp/pip-OGQupl-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', 
'/tmp/pip-OGQupl-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', 
"[Errno 1] Operation not permitted: '/tmp/pip-OGQupl-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-OGQupl-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', 
"[Errno 1] Operation not permitted: '/tmp/pip-OGQupl-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-OGQupl-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', 
"[Errno 1] Operation not permitted: '/tmp/pip-OGQupl-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-OGQupl-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', 
"[Errno 1] Operation not permitted: '/tmp/pip-OGQupl-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'")]

【问题讨论】:

    标签: python pip tensorflow


    【解决方案1】:

    这对我有用:

    sudo -H pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl --upgrade --ignore-installed six
    

    【讨论】:

      【解决方案2】:

      我听说 32 位系统会出现此错误,因为 tensorflow 应该在 64 位上运行。

      查看此链接https://github.com/tensorflow/tensorflow/issues/33

      我刚刚安装了 tensorflow。我从使用 ubuntu 16 切换到 14。所以使用 Ubuntu14.04.5 x64 可以工作。

      查看此答案以了解 tensorflow 的理想系统要求:

      Tensorflow recommended system specifications?

      【讨论】:

        猜你喜欢
        • 2023-03-22
        • 1970-01-01
        • 2018-11-06
        • 2018-03-12
        • 1970-01-01
        • 2017-07-08
        • 2016-04-27
        • 2015-12-07
        • 2019-09-15
        相关资源
        最近更新 更多