初尝TensorFlow(环境搭建)---踩过的坑

1、OSError: [Errno 13] Permission denied:

遇到这个问题的原因是因为权限不足,所以在你的命令前面加上sudo就好

2、 解决 mac OSX pip OSError: [Errno 1] Operation not permitted

执行如下命令

pip install --upgrade /Users/tiancb/Downloads/tensorflow-0.11.0rc1-py2-none-any.whl

/Users/tiancb/Downloads/tensorflow-0.11.0rc1-py2-none-any.whl
这个是自己下载的whl文件
直接执行

pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.11.0rc1-py2-none-any.whl

需要翻墙 请自行选择安装命令

执行后界面见下图

这里写图片描述

报错内容如下

Installing collected packages: six, setuptools, protobuf, numpy, funcsigs, pbr, mock, wheel, tensorflow
  Found existing installation: six 1.4.1
    DEPRECATION: Uninstalling a distutils installed project (six) 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 six-1.4.1:
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: '/var/folders/7g/wzz4kvyj6lg3zp5ksf7pc86w0000gn/T/pip-Edj4pA-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

遇到这个问题的时候把上面的命令换成

sudo pip install  /Users/tiancb/Downloads/tensorflow-0.11.0rc1-py2-none-any.whl --upgrade --ignore-installed six

安装成功的界面如下图

这里写图片描述

参考资料
Tensorflow
TensorFlow 中文社区
文件下载
Tensorflow 安装文件(whl文件) linux环境
Tensorflow 安装文件(whl文件) mac环境

猜你喜欢

转载自blog.csdn.net/wanzhuanit/article/details/78674767