解决安装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 相关文章推荐
Ubuntu 14.04+Django 1.7.1+Nginx+uwsgi部署教程
Nov 18 Python
python采用django框架实现支付宝即时到帐接口
May 17 Python
python 遍历字符串(含汉字)实例详解
Apr 04 Python
利用Python将时间或时间间隔转为ISO 8601格式方法示例
Sep 05 Python
Python协程的用法和例子详解
Sep 09 Python
使用pandas的DataFrame的plot方法绘制图像的实例
May 24 Python
Python3中内置类型bytes和str用法及byte和string之间各种编码转换 问题
Sep 27 Python
python自动发微信监控报警
Sep 06 Python
Numpy一维线性插值函数的用法
Apr 22 Python
详解如何修改jupyter notebook的默认目录和默认浏览器
Jan 24 Python
python小程序之飘落的银杏
Apr 17 Python
基于Python实现股票收益率分析
Apr 02 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下批量挂马和批量清马代码
2011/02/27 PHP
php中strtotime函数用法详解
2014/11/15 PHP
php获取当月最后一天函数分享
2015/02/02 PHP
PHP curl模拟登录带验证码的网站
2015/11/30 PHP
js下通过getList函数实现分页效果的代码
2010/09/17 Javascript
JQuery1.4+ Ajax IE8 内存泄漏问题
2010/10/15 Javascript
实现变速回到顶部的JavaScript代码
2011/05/09 Javascript
文本框input聚焦失焦样式实现代码
2012/10/12 Javascript
js运动框架_包括图片的淡入淡出效果
2013/05/11 Javascript
Jquery封装tab自动切换效果的具体实现
2013/07/13 Javascript
Js中的onblur和onfocus事件应用介绍
2013/08/27 Javascript
JS实现距离上次刷新已过多少秒示例
2014/05/23 Javascript
TinyMCE汉化及本地上传图片功能实例详解
2016/05/31 Javascript
AngularJS入门之动画
2016/07/27 Javascript
node.js缺少mysql模块运行报错的解决方法
2016/11/13 Javascript
JQuery 动态生成Table表格实例代码
2016/12/02 Javascript
jquery mobile移动端幻灯片滑动切换效果
2020/04/15 Javascript
jQuery滚动插件scrollable.js用法分析
2017/05/25 jQuery
Node 自动化部署的方法
2017/10/17 Javascript
Vue父子模版传值及组件传值的三种方法
2017/11/27 Javascript
JS+HTML5实现获取手机验证码倒计时按钮
2018/08/08 Javascript
vee-validate vue 2.0自定义表单验证的实例
2018/08/28 Javascript
vue和better-scroll实现列表左右联动效果详解
2019/04/29 Javascript
[54:54]Newbee vs Serenity 2018国际邀请赛小组赛BO2 第一场 8.17
2018/08/18 DOTA
Python实现登录人人网并抓取新鲜事的方法
2015/05/11 Python
详解Python核心对象类型字符串
2018/02/11 Python
Python通用函数实现数组计算的方法
2019/06/13 Python
应用OpenCV和Python进行SIFT算法的实现详解
2019/08/21 Python
django连接oracle时setting 配置方法
2019/08/29 Python
美国高级音响品牌:Master&Dynamic
2018/07/05 全球购物
科研课题实施方案
2014/03/18 职场文书
关于拾金不昧的感谢信
2015/01/21 职场文书
盗窃案辩护词
2015/05/21 职场文书
《桂花雨》教学反思
2016/02/19 职场文书
学校教代会开幕词
2016/03/04 职场文书
Django REST framework 限流功能的使用
2021/06/24 Python