zoukankan      html  css  js  c++  java
  • 安装 tensorflow 时遇到 OSError: [Errno 1] Operation not permitted 的解决办法

    Installing collected packages: numpy, scipy, six, pyyaml, Keras, opencv-python, h5py, html5lib, bleach, futures, wheel, werkzeug, markdown, protobuf, tensorflow-tensorboard, pbr, funcsigs, mock, backports.weakref, tensorflow
      Found existing installation: numpy 1.14.1
        Uninstalling numpy-1.14.1:
          Successfully uninstalled numpy-1.14.1
      Found existing installation: scipy 0.13.0b1
        DEPRECATION: Uninstalling a distutils installed project (scipy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
        Uninstalling scipy-0.13.0b1:
    Exception:
    Traceback (most recent call last):
      File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
        status = self.run(options, args)
      File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
        prefix=options.prefix_path,
      File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 778, in install
        requirement.uninstall(auto_confirm=True)
      File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
        paths_to_remove.remove(auto_confirm)
      File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
        renames(path, new_path)
      File "/Library/Python/2.7/site-packages/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 302, in move
        copy2(src, real_dst)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
        copystat(src, dst)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
        os.chflags(dst, st.st_flags)
    OSError: [Errno 1] Operation not permitted: '/tmp/pip-k6sIvY-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/scipy-0.13.0b1-py2.7.egg-info'
    

      

    首先我想到的是目录权限的问题,于是一通的修改 不知道执行了多少次的 ```chmod 755``` 结果没有任何卵用;

    那是不是因为 目录归属有问题呢? 又是一通修改 ```chown usename``` 结果还是没有用;

    最后只好谷歌了,搜到这篇文章:https://www.jianshu.com/p/7a18c78b5982, yes 他解决了我的问题,只需要小小的升级下旧的包就可以搞定了,这里把执行的命令记录如下:

    $ pip install --upgrade pip
    
    $ sudo pip install numpy --upgrade --ignore-installed
    $ sudo pip install scipy --upgrade --ignore-installed
    $ sudo pip install scikit-learn --upgrade --ignore-installed
    

      

  • 相关阅读:
    c++ string::size详解
    fatal error LNK1120: 1 个无法解析的外部命令
    c多个空格转成一个空格
    算法导论之三:快速排序
    转:C++中cin、cin.get()、cin.getline()、getline()、gets()等函数的用法
    vc6.0怎么调整工作空间到左边??
    2008生产实习 C++ 实习计划
    WCF是什么
    收藏:Silverlight 2.0 Beta Control Hierarchy (Silverlight 2.0控件层次结构图)
    A potentially dangerous Request.Form value was detected from the client 的解决方法
  • 原文地址:https://www.cnblogs.com/mliudong/p/8459556.html
Copyright © 2011-2022 走看看