解决安装tensorflow遇到无法卸载numpy 1.8.0rc1的问题


Posted in Python onJune 13, 2018

最近在关注 Deep Learning,就在自己的mac上安装google的开源框架Tensorflow

用 sudo pip install -U tensorflow

安装的时候总是遇到下面的问题:

sudo pip install -U tensorflow
Password:
The directory '/Users/jason/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/jason/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting tensorflow
 Downloading tensorflow-1.0.0-cp27-cp27m-macosx_10_11_x86_64.whl (39.3MB)
100% |????????????????????????????????| 39.4MB 32kB/s 
Collecting numpy>=1.11.0 (from tensorflow)
 Downloading numpy-1.12.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.4MB)
100% |????????????????????????????????| 4.4MB 195kB/s 
Requirement already up-to-date: six>=1.10.0 in /Library/Python/2.7/site-packages/six-1.10.0-py2.7.egg (from tensorflow)
Requirement already up-to-date: mock>=2.0.0 in /Library/Python/2.7/site-packages (from tensorflow)
Requirement already up-to-date: wheel in /Library/Python/2.7/site-packages (from tensorflow)
Requirement already up-to-date: protobuf>=3.1.0 in /Library/Python/2.7/site-packages (from tensorflow)
Requirement already up-to-date: funcsigs>=1; python_version < "3.3" in /Library/Python/2.7/site-packages (from mock>=2.0.0->tensorflow)
Requirement already up-to-date: pbr>=0.11 in /Library/Python/2.7/site-packages (from mock>=2.0.0->tensorflow)
Collecting setuptools (from protobuf>=3.1.0->tensorflow)
 Downloading setuptools-34.3.0-py2.py3-none-any.whl (389kB)
100% |????????????????????????????????| 399kB 1.1MB/s 
Requirement already up-to-date: packaging>=16.8 in /Library/Python/2.7/site-packages (from setuptools->protobuf>=3.1.0->tensorflow)
Requirement already up-to-date: appdirs>=1.4.0 in /Library/Python/2.7/site-packages (from setuptools->protobuf>=3.1.0->tensorflow)
Collecting pyparsing (from packaging>=16.8->setuptools->protobuf>=3.1.0->tensorflow)
 Downloading pyparsing-2.1.10-py2.py3-none-any.whl (56kB)
100% |????????????????????????????????| 61kB 2.5MB/s 
Installing collected packages: numpy, tensorflow, setuptools, pyparsing
 Found existing installation: numpy 1.8.0rc1
DEPRECATION: Uninstalling a distutils installed project (numpy) 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 numpy-1.8.0rc1:
Exception:
Traceback (most recent call last):
 File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
 File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
 File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
 File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
 File "/Library/Python/2.7/site-packages/pip-9.0.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-9.0.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 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-aGEdP5-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'

后来google到 需要在命令后面加上 ?ignore-installed six

就成功了,不过知其然,而不知其所以然

localhost:Desktop jasonlee$ sudo -H pip install tensorflow --ignore-installed six
The directory '/Users/jason/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/jason/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting tensorflow
 Downloading tensorflow-1.0.0-cp27-cp27m-macosx_10_11_x86_64.whl (39.3MB)
100% |????????????????????????????????| 39.4MB 29kB/s 
Collecting six
 Downloading six-1.10.0-py2.py3-none-any.whl
Collecting numpy>=1.11.0 (from tensorflow)
 Downloading numpy-1.12.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.4MB)
100% |????????????????????????????????| 4.4MB 210kB/s 
Collecting mock>=2.0.0 (from tensorflow)
 Downloading mock-2.0.0-py2.py3-none-any.whl (56kB)
100% |????????????????????????????????| 61kB 556kB/s 
Collecting wheel (from tensorflow)
 Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
100% |????????????????????????????????| 71kB 586kB/s 
Collecting protobuf>=3.1.0 (from tensorflow)
 Downloading protobuf-3.2.0-py2.py3-none-any.whl (360kB)
100% |????????????????????????????????| 368kB 922kB/s 
Collecting funcsigs>=1; python_version < "3.3" (from mock>=2.0.0->tensorflow)
 Downloading funcsigs-1.0.2-py2.py3-none-any.whl
Collecting pbr>=0.11 (from mock>=2.0.0->tensorflow)
 Downloading pbr-1.10.0-py2.py3-none-any.whl (96kB)
100% |????????????????????????????????| 102kB 1.1MB/s 
Collecting setuptools (from protobuf>=3.1.0->tensorflow)
 Downloading setuptools-34.3.0-py2.py3-none-any.whl (389kB)
100% |????????????????????????????????| 399kB 657kB/s 
Collecting packaging>=16.8 (from setuptools->protobuf>=3.1.0->tensorflow)
 Downloading packaging-16.8-py2.py3-none-any.whl
Collecting appdirs>=1.4.0 (from setuptools->protobuf>=3.1.0->tensorflow)
 Downloading appdirs-1.4.2-py2.py3-none-any.whl
Collecting pyparsing (from packaging>=16.8->setuptools->protobuf>=3.1.0->tensorflow)
 Downloading pyparsing-2.1.10-py2.py3-none-any.whl (56kB)
100% |????????????????????????????????| 61kB 1.0MB/s 
Installing collected packages: numpy, funcsigs, six, pbr, mock, wheel, pyparsing, packaging, appdirs, setuptools, protobuf, tensorflow
Successfully installed appdirs-1.4.2 funcsigs-1.0.2 mock-2.0.0 numpy-1.12.0 packaging-16.8 pbr-1.10.0 protobuf-3.2.0 pyparsing-2.1.10 setuptools-34.3.0 six-1.10.0 tensorflow-1.0.0 wheel-0.29.0

以上这篇解决安装tensorflow遇到无法卸载numpy 1.8.0rc1的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持三水点靠木。

Python 相关文章推荐
Python中使用装饰器来优化尾递归的示例
Jun 18 Python
Python双精度浮点数运算并分行显示操作示例
Jul 21 Python
python+mongodb数据抓取详细介绍
Oct 25 Python
详解Python_shutil模块
Mar 15 Python
python3使用print打印带颜色的字符串代码实例
Aug 22 Python
Anaconda 查看、创建、管理和使用python环境的方法
Dec 03 Python
python @propert装饰器使用方法原理解析
Dec 25 Python
python shutil文件操作工具使用实例分析
Dec 25 Python
python 链接sqlserver 写接口实例
Mar 11 Python
使用Matplotlib绘制不同颜色的带箭头的线实例
Apr 17 Python
Jupyter打开图形界面并画出正弦函数图像实例
Apr 24 Python
Django:使用filter的pk进行多值查询操作
Jul 15 Python
Python实现的朴素贝叶斯算法经典示例【测试可用】
Jun 13 #Python
Python使用matplotlib和pandas实现的画图操作【经典示例】
Jun 13 #Python
使用python爬虫获取黄金价格的核心代码
Jun 13 #Python
Python实现爬虫从网络上下载文档的实例代码
Jun 13 #Python
Pycharm导入Python包,模块的图文教程
Jun 13 #Python
mac下pycharm设置python版本的图文教程
Jun 13 #Python
使用Python来开发微信功能
Jun 13 #Python
You might like
PHP转换IP地址到真实地址的方法详解
2013/06/09 PHP
php 使用GD库为页面增加水印示例代码
2014/03/24 PHP
php短网址和数字之间相互转换的方法
2015/03/13 PHP
JavaScript 组件之旅(二)编码实现和算法
2009/10/28 Javascript
九种js弹出对话框的方法总结
2013/03/12 Javascript
jQuery拖动图片删除示例
2013/05/10 Javascript
jquery ajax跨域解决方法(json方式)
2014/02/04 Javascript
关于JavaScript的变量的数据类型的判断方法
2015/08/14 Javascript
JS获取input file绝对路径的方法(推荐)
2016/08/02 Javascript
jquery dataTable 获取某行数据
2017/05/05 jQuery
微信小程序 选项卡的简单实例
2017/05/24 Javascript
JavaScript异步加载问题总结
2018/02/17 Javascript
JavaScript中click和onclick本质区别与用法分析
2018/06/07 Javascript
微信小程序使用wx.request请求服务器json数据并渲染到页面操作示例
2019/03/30 Javascript
微信小程序实现语音识别转文字功能及遇到的坑
2019/08/02 Javascript
简介JavaScript错误处理机制
2020/08/04 Javascript
Vue 实现拨打电话操作
2020/11/16 Javascript
[03:11]TI9战队档案 - Alliance
2019/08/20 DOTA
python基础教程之数字处理(math)模块详解
2014/03/25 Python
python随机取list中的元素方法
2018/04/08 Python
pandas.DataFrame 根据条件新建列并赋值的方法
2018/04/08 Python
numpy.linspace 生成等差数组的方法
2018/07/02 Python
Python、 Pycharm、Django安装详细教程(图文)
2019/04/12 Python
python3实现二叉树的遍历与递归算法解析(小结)
2019/07/03 Python
浅谈HTML5中dialog元素尝鲜
2018/10/15 HTML / CSS
资深生产主管自我评价
2013/09/22 职场文书
工程预算与管理应届生求职信
2013/10/06 职场文书
小学教师的自我评价范例
2013/10/31 职场文书
音乐兴趣小组活动总结
2014/07/07 职场文书
医院领导班子四风对照检查材料
2014/09/27 职场文书
2015学习委员工作总结范文
2015/04/03 职场文书
校园新闻稿范文
2015/07/18 职场文书
2016国培学习心得体会
2016/01/08 职场文书
实用干货:敬酒词大全,帮你应付各种场合
2019/11/21 职场文书
再见,2019我们不负使命;你好,2020我们砥砺前行
2020/01/03 职场文书
MySQL面试题讲解之如何设置Hash索引
2021/11/01 MySQL