我们相信:世界是美好的,你是我也是。平行空间的世界里面,不同版本的生活也在继续...

首先承认一点,苏南大叔也不知道numpy具体是用来做什么的。对于python脚本,一直是只可远观而不可亵玩的态度。一般来说,碰到不认识的语言写的功能的时候,苏南大叔会努力把他翻译成自己能看懂的语言,比如php或者.net之类的。不过本着学习的态度,这次,是硬着头皮试着安装了python脚本,操作完成后,觉得也没有那么的恐怖或者复杂。

苏南大叔:mac系统,如何卸载重装 python 库 numpy ? - mac_numpy
mac系统,如何卸载重装 python 库 numpy ?(图4-1)

本来是准备使用pip安装myqr的,但是安装过程中报错了,说系统已有的numpy这个库的版本太低。那么,就使用pip uninstall numpy吧,准备先卸载再安装。不过,这个时候,邪门的事情就发现了。卸载失败。加上sudo也一样报错。真心是上火了。

经过万能的百度提示,据说是MacSystem Integrity Protection的问题,解决的办法是关闭保护SIP。操作如下:

步骤1

重启电脑,电脑启动的时候按住command+R快捷键。

苏南大叔:mac系统,如何卸载重装 python 库 numpy ? - mac-recovery-1
mac系统,如何卸载重装 python 库 numpy ?(图4-2)

步骤2

等画面上显示苹果logo的时候之后,你会看到顶部菜单「实用工具」,选择子菜单"终端";

苏南大叔:mac系统,如何卸载重装 python 库 numpy ? - mac-recovery-2
mac系统,如何卸载重装 python 库 numpy ?(图4-3)

步骤3

然后终端就打开了,你直接输入 csrutil disable ,输完之后重启;

苏南大叔:mac系统,如何卸载重装 python 库 numpy ? - mac-recovery-3
mac系统,如何卸载重装 python 库 numpy ?(图4-4)

重启重装

电脑重启之后,再重新执行 sudo pip install -U numpy ,卸载成功完成。然后pip install myqr就顺利安装完成了,好开心的节奏~

localhost:test2 sunan$ sudo pip install -U numpy
Password:
The directory '/Users/sunan/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/sunan/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 numpy
  Downloading numpy-1.13.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.6MB)
    100% |████████████████████████████████| 4.6MB 231kB/s
Installing collected packages: numpy
  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:
      Successfully uninstalled numpy-1.8.0rc1
Successfully installed numpy-1.13.0

相关文章

总结

如果本文对您有帮助,或者节约了您的时间,欢迎打赏瓶饮料,建立下友谊关系。
本博客不欢迎:各种镜像采集行为。请尊重原创文章内容,转载请保留作者链接。

 【福利】 腾讯云最新爆款活动!1核2G云服务器首年50元!

 【源码】本文代码片段及相关软件,请点此获取更多信息

 【绝密】秘籍文章入口,仅传授于有缘之人   mac    python