解决安装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 正则式 概述及常用字符
May 07 Python
Python面向对象编程中关于类和方法的学习笔记
Jun 30 Python
python下如何查询CS反恐精英的服务器信息
Jan 17 Python
python 去除txt文本中的空格、数字、特定字母等方法
Jul 24 Python
Python并行分布式框架Celery详解
Oct 15 Python
Python pip 安装与使用(安装、更新、删除)
Oct 06 Python
python中前缀运算符 *和 **的用法示例详解
May 28 Python
Python3通过chmod修改目录或文件权限的方法示例
Jun 08 Python
在 Windows 下搭建高效的 django 开发环境的详细教程
Jul 27 Python
20行Python代码实现一款永久免费PDF编辑工具的实现
Aug 27 Python
python用tkinter实现一个gui的翻译工具
Oct 26 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
NO3第三帝国留言簿制作过程
2006/10/09 PHP
PHP三元运算的2种写法代码实例
2014/05/12 PHP
php程序员应具有的7种能力小结
2014/11/27 PHP
PHP读取文件的常见几种方法
2016/11/03 PHP
利用PHP实现开心消消乐的算法示例
2017/10/12 PHP
文字幻灯片
2006/06/26 Javascript
js中eval详解
2012/03/30 Javascript
php析构函数的具体用法小结
2014/03/11 Javascript
ECMAScript5中的对象存取器属性:getter和setter介绍
2014/12/08 Javascript
jQuery弹出框代码封装DialogHelper
2015/01/30 Javascript
js实现的Easy Tabs选项卡用法实例
2015/09/06 Javascript
给easyui datebox扩展一个清空的实例
2016/11/09 Javascript
微信公众号 摇一摇周边功能开发
2016/12/08 Javascript
jQuery实现div跟随鼠标移动
2020/08/20 jQuery
微信小程序实现登录遮罩效果
2018/11/01 Javascript
微信小程序分享功能onShareAppMessage(options)用法分析
2019/04/24 Javascript
搭建Vue从Vue-cli到router路由护卫的实现
2019/11/14 Javascript
JavaScript实现下拉列表
2021/01/20 Javascript
[02:27]《DAC最前线》之附加赛征程
2015/01/29 DOTA
Python获取当前时间的方法
2014/01/14 Python
python目录操作之python遍历文件夹后将结果存储为xml
2014/01/27 Python
Python中optparse模块使用浅析
2015/01/01 Python
python自动重试第三方包retrying模块的方法
2018/04/24 Python
Python numpy实现二维数组和一维数组拼接的方法
2018/06/05 Python
使用Anaconda3建立虚拟独立的python2.7环境方法
2018/06/11 Python
Python时间序列处理之ARIMA模型的使用讲解
2019/04/02 Python
python3实现字符串操作的实例代码
2019/04/16 Python
pycharm创建scrapy项目教程及遇到的坑解析
2019/08/15 Python
Python如何读写字节数据
2020/08/05 Python
10 套华丽的CSS3 按钮小结
2012/10/03 HTML / CSS
简历的个人自我评价范文
2014/01/03 职场文书
外语系大学生自荐信范文
2014/03/01 职场文书
工地安全质量标语
2014/06/07 职场文书
PHP中国际化的字符串排序和比较对象详解
2021/08/23 PHP
《吸血鬼幸存者》新内容发布 追加多个全新模式
2022/04/07 其他游戏
人物搭配车车超萌联名预备中 【咒术迴战】 ⨯ 【天竺鼠车车】 展开合作
2022/04/11 日漫