mac系统,如何卸载 python 库 numpy ?
发布于 作者:苏南大叔 来源:程序如此灵动~首先承认一点,苏南大叔也不知道numpy
具体是用来做什么的。对于python
脚本,一直是只可远观而不可亵玩的态度。一般来说,碰到不认识的语言写的功能的时候,苏南大叔会努力把他翻译成自己能看懂的语言,比如php
或者.net
之类的。不过本着学习的态度,这次,是硬着头皮试着安装了python
脚本,操作完成后,觉得也没有那么的恐怖或者复杂。
本来是准备使用pip
安装myqr
的,但是安装过程中报错了,说系统已有的numpy
这个库的版本太低。那么,就使用pip uninstall numpy
吧,准备先卸载再安装。不过,这个时候,邪门的事情就发现了。卸载失败。加上sudo
也一样报错。真心是上火了。
经过万能的百度提示,据说是Mac
的System Integrity Protection
的问题,解决的办法是关闭保护SIP
。操作如下:
步骤1
重启电脑,电脑启动的时候按住command+R
快捷键。
步骤2
等画面上显示苹果logo的时候之后,你会看到顶部菜单「实用工具」,选择子菜单"终端";
步骤3
然后终端就打开了,你直接输入 csrutil disable
,输完之后重启;
相关文章
总结
电脑重启之后,再重新执行 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
上面进入mac
恢复模式的情况,和这里的操作挺像的,大家可以对比看看。



本站采用创作共用版权协议, 要求署名、非商业用途和相同方式共享。
转载本站内容必须也遵循“署名-非商业用途-相同方式共享”的创作共用协议。
未经许可,规模化镜像抄袭本站内容的行为,将会根据有关法律法规进行维权。
《程序如此灵动~》下所有原创文章,如被用于商业用途,请您按规定支付稿费。
转载本站内容必须也遵循“署名-非商业用途-相同方式共享”的创作共用协议。
未经许可,规模化镜像抄袭本站内容的行为,将会根据有关法律法规进行维权。
《程序如此灵动~》下所有原创文章,如被用于商业用途,请您按规定支付稿费。
本站的忠实读者小伙伴,正在阅读下面这些文章: