解决安装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对json的操作总结
Jan 05 Python
python爬虫入门教程--正则表达式完全指南(五)
May 25 Python
解决pandas.DataFrame.fillna 填充Nan失败的问题
Nov 06 Python
python aiohttp的使用详解
Jun 20 Python
python实现加密的方式总结
Jan 19 Python
python正则过滤字母、中文、数字及特殊字符方法详解
Feb 11 Python
python 解决print数组/矩阵无法完整输出的问题
Feb 19 Python
pytorch实现保证每次运行使用的随机数都相同
Feb 20 Python
Python列表切片常用操作实例解析
Mar 10 Python
Python+redis通过限流保护高并发系统
Apr 15 Python
解决Python字典查找报Keyerror的问题
May 26 Python
Pytorch中Softmax与LogSigmoid的对比分析
Jun 05 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
Linux环境下搭建php开发环境的操作步骤
2013/06/17 PHP
php中time()和mktime()方法的区别
2013/09/28 PHP
php生成圆角图片的方法
2015/04/07 PHP
1亿条数据如何分表100张到Mysql数据库中(PHP)
2015/07/29 PHP
64位windows系统下安装Memcache缓存
2015/12/06 PHP
28个JS验证函数收集
2010/03/02 Javascript
Js 时间间隔计算的函数(间隔天数)
2011/11/15 Javascript
33个优秀的 jQuery 图片展示插件分享
2012/03/14 Javascript
js动态生成指定行数的表格
2013/07/11 Javascript
用Jquery.load载入页面实现局部刷新
2014/01/22 Javascript
JavaScript返回上一页的三种方法及区别介绍
2015/07/04 Javascript
javascript超过容器后显示省略号效果的方法(兼容一行或者多行)
2016/07/14 Javascript
node+experss实现爬取电影天堂爬虫
2016/11/20 Javascript
vue2.0中goods选购栏滚动算法的实现代码
2017/05/17 Javascript
微信小程序绘制图片发送朋友圈
2019/07/25 Javascript
vue单页应用的内存泄露定位和修复问题小结
2019/08/02 Javascript
微信小程序实现语音识别转文字功能及遇到的坑
2019/08/02 Javascript
[04:59]DOTA2-DPC中国联赛 正赛 Ehome vs iG 选手采访
2021/03/11 DOTA
python登录pop3邮件服务器接收邮件的方法
2015/04/30 Python
Python中 map()函数的用法详解
2018/07/10 Python
python: 判断tuple、list、dict是否为空的方法
2018/10/22 Python
利用python、tensorflow、opencv、pyqt5实现人脸实时签到系统
2019/09/25 Python
Python 3.8正式发布,来尝鲜这些新特性吧
2019/10/15 Python
Keras使用ImageNet上预训练的模型方式
2020/05/23 Python
使用bandit对目标python代码进行安全函数扫描的案例分析
2021/01/27 Python
ProBikeKit美国官网:自行车套件,跑步和铁人三项套件
2016/10/13 全球购物
Gina Bacconi官网:吉娜贝康尼连衣裙和礼服
2018/04/24 全球购物
前台接待的工作职责
2013/11/21 职场文书
工作会议主持词
2014/03/17 职场文书
《月球之谜》教学反思
2014/04/10 职场文书
家长对孩子的评语
2014/04/18 职场文书
个人委托书怎么写
2014/09/17 职场文书
财务工作犯错检讨书
2014/10/07 职场文书
开展党的群众路线教育实践活动工作总结
2014/11/05 职场文书
情侣餐厅的创业计划书范本!
2019/07/26 职场文书
2019预备党员转正申请书模板2篇!
2019/08/07 职场文书