1. 程式人生 > >使用 tensorflow 我遇到了這樣的錯誤

使用 tensorflow 我遇到了這樣的錯誤

down remove self. learn open versions moc works 3.0

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

  

使用 tensorflow 我遇到了這樣的錯誤