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

最近在关注 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的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持我们。

(0)

相关推荐

  • Python NumPy库安装使用笔记

    1. NumPy安装 使用pip包管理工具进行安装 复制代码 代码如下: $ sudo pip install numpy 使用pip包管理工具安装ipython(交互式shell工具) 复制代码 代码如下: $ sudo pip instlal ipython $ ipython --pylab  #pylab模式下, 会自动导入SciPy, NumPy, Matplotlib模块 2. NumPy基础 2.1. NumPy数组对象 具体解释可以看每一行代码后的解释和输出 复制代码 代码如下:

  • Python中Numpy包的安装与使用方法简明教程

    本文实例讲述了Python中Numpy包的安装与使用方法.分享给大家供大家参考,具体如下: Numpy包的安装 准备工作 1. Python安装 2. pip安装(如使用pip安装命令:pip install numpy) 3. 将pip所在的文件夹添加到环境变量path路径中 4. 下载相应的Numpy安装包,.whl格式.下载链接. 以上准备工作准备完毕之后,进行Numpy安装,先进入whl安装包的存放目录.比如在C盘: cd C:\ 再使用命令行安装: pip install numpy文

  • python的numpy模块安装不成功简单解决方法总结

    为了画个图,被numpy这个模块的安装真的折腾疯了!!!一直装不上,花了几个小时,看了网上的很多教程.方法发现总结得不是很全,这里总结一下,防止大家再出现这个问题没有解决方法. Python的魅力之一,就是拥有众多功能强大的插件,但是这些插件的寻找.安装.升级在windows系统上却非常之麻烦.首先安装完Python后需要在系统配置环境变量,接下来又要安装Setuptools,而且安装过程中还会报编码错误,对于需要拷贝源码安装的还需要去CMD里打命令,还得小心翼翼避免打错参数,如果没有一位有经验

  • Python Numpy库安装与基本操作示例

    本文实例讲述了Python Numpy库安装与基本操作.分享给大家供大家参考,具体如下: 概述 NumPy(Numeric Python)扩展包提供了数组功能,以及对数据进行快速处理的函数. NumPy 通常与 SciPy(Scientific Python)和 Matplotlib(绘图库)一起使用. 安装 通过pip安装numpy pip install numpy Numpy基本操作 >>> import numpy as np #一般以np作为numpy的别名 >>&

  • windows下numpy下载与安装图文教程

    Numpy介绍 NumPy系统是Python的一种开源的数值计算扩展.这种工具可用来存储和处理大型矩阵,比Python自身的嵌套列表(nested list structure)结构要高效的多(该结构也可以用来表示矩阵(matrix)).据说NumPy将Python相当于变成一种免费的更强大的MatLab系统. 外文名:numpy 含义:Python的一种开源的数字扩展 内容:一个强大的N维数组对象Array 用途:存储和处理大型矩阵 一个用python实现的科学计算包.包括:1.一个强大的N维

  • python安装numpy&安装matplotlib& scipy的教程

    numpy安装 下载地址:https://pypi.python.org/pypi/numpy(各取所需) copy安装目录.eg:鄙人的D:\python3.6.1\Scripts pip install :eg: win+R ----->  CMD ---->    pip install D:\python3.6.1\Scripts\numpy-1.13.0rc2-cp36-none-win_amd64.whl 安装成功: 同理: 安装matplotlib 安装scipy 以上这篇pyt

  • mac安装pytorch及系统的numpy更新方法

    安装Pytorch 在pytorch官网上选择相应选项,我的是OS X, pip, python2.7, none CUDA. (之所以用python2.7只是觉得现在还有好多代码用2.7写的,用3+版本经常会由于语法更新而报错.而且用3+的话sublime还要配下python3 的building system......) 打开terminal,输入: sudo pip install http://download.pytorch.org/whl/torch-0.3.0.post4-cp2

  • 详解Python中的Numpy、SciPy、MatPlotLib安装与配置

    用Python来编写机器学习方面的代码是相当简单的,因为Python下有很多关于机器学习的库.其中下面三个库numpy,scipy,matplotlib,scikit-learn是常用组合,分别是科学计算包,科学工具集,画图工具包,机器学习工具集. numpy :主要用来做一些科学运算,主要是矩阵的运算.NumPy为Python带来了真正的多维数组功能,并且提供了丰富的函数库处理这些数组.它将常用的数学函数都进行数组化,使得这些数学函数能够直接对数组进行操作,将本来需要在Python级别进行的循

  • python3.6下Numpy库下载与安装图文教程

    今天在做Plotly的散点图时,需要Numpy 这个库的使用. 没有安装Numpy这个库的时候,报错一般是下图这样:ModuleNotFoundError: No module named 'numpy' 看到这个错,肯定是Numpy这个库没有安装导致的结果. 下面讲讲这个库的安装与使用.这里我的python版本是3.6. 下载安装这个库的第一反应就是,pip install numpy 但是结果. 什么鬼.竟然安装报错.算了还是去下载安装包安装 下载地址为:点加链接 这个地址里面涵盖了你想要的

  • 详解windows python3.7安装numpy问题的解决方法

    我的是win7的系统,去python官网下载python3.7安装 CMD  #打开命令窗口 pip install numpy #在cmd中输入 提示 需要c++14.0, 解决办法: 1, 进入https://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud 我的是win10的系统,去python官网下载python3.7安装 CMD  #打开命令窗口 pip install numpy #在cmd中输入 提示 需要c++14.0, 解决办法: 1,

  • Python安装Numpy和matplotlib的方法(推荐)

    Python安装Numpy和matplotlib的方法(推荐) 注意: 下载的库名中cp27代表python2.7,其它同理. 在shell中输入import pip; print(pip.pep425tags.get_supported())可以获取到pip支持的文件名还有版本 ================安装Numpy==================== 下载地址: https://pypi.python.org/pypi/numpy  类似 numpy-1.13.3-cp36-no

  • windows 下python+numpy安装实用教程

    如题,今天兜兜转转找了很多网站帖子,一个个环节击破,最后装好费了不少时间. 希望这个帖子能帮助有需要的人,教你一篇帖子搞定python+numpy,节约科研时间. 水平有限,难免存在不足,敬请指正. *******************python安装**************************************************** step1:官网下载安装包: https://www.python.org/ 我下载的是python-3.4.4.msi step2:pyt

随机推荐