• 安装 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
    

      

  • 相关阅读:
    MySQL链接超时的解决办法
    使用Axis开发Web Service程序
    Linux动态库(.so)搜索路径
    MYSQL性能调优简述
    什么是AXIS
    巧夺天工的kfifo
    双离合DSG
    实例讲解C# WebService
    如何为 MySQL 选择更合适的服务器硬件
    7 MySQL 事务与锁定命令
  • 原文地址:https://www.cnblogs.com/mliudong/p/8459556.html
Copyright © 2020-2023  润新知