为了账号安全,请及时绑定邮箱和手机立即绑定

在OSX 10.11(El Capitan)中安装Scrapy(系统完整性保护)

在OSX 10.11(El Capitan)中安装Scrapy(系统完整性保护)

慕码人8056858 2019-12-10 09:40:53
我正在尝试通过pip在OSX 10.11(El Capitan)中安装Scrapy Python框架。安装脚本将下载所需的模块,并在某些时候返回以下错误:OSError: [Errno 1] Operation not permitted: '/tmp/pip-nIfswi-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'我尝试使用以下命令停用OSX 10.11中的无根功能:sudo nvram boot-args="rootless=0";sudo reboot但是当机器重启时,我仍然收到相同的错误。我的StackExchangers同事有什么线索或想法吗?如果有帮助,则完整的脚本输出如下:sudo -s pip install scrapyCollecting scrapy  Downloading Scrapy-1.0.2-py2-none-any.whl (290kB)    100% |████████████████████████████████| 290kB 345kB/s Requirement already satisfied (use --upgrade to upgrade): cssselect>=0.9 in /Library/Python/2.7/site-packages (from scrapy)Requirement already satisfied (use --upgrade to upgrade): queuelib in /Library/Python/2.7/site-packages (from scrapy)Requirement already satisfied (use --upgrade to upgrade): pyOpenSSL in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from scrapy)Collecting w3lib>=1.8.0 (from scrapy)  Downloading w3lib-1.12.0-py2.py3-none-any.whlCollecting lxml (from scrapy)  Downloading lxml-3.4.4.tar.gz (3.5MB)    100% |████████████████████████████████| 3.5MB 112kB/s Collecting Twisted>=10.0.0 (from scrapy)  Downloading Twisted-15.3.0.tar.bz2 (4.4MB)    100% |████████████████████████████████| 4.4MB 94kB/s Collecting six>=1.5.2 (from scrapy)  Downloading six-1.9.0-py2.py3-none-any.whlRequirement already satisfied (use --upgrade to upgrade): zope.interface>=3.6.0 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from Twisted>=10.0.0->scrapy)Requirement already satisfied (use --upgrade to upgrade): setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from zope.interface>=3.6.0->Twisted>=10.0.0->scrapy)Installing collected packages: six, w3lib, lxml, Twisted, scrapy
查看完整描述

3 回答

?
收到一只叮咚

TA贡献1821条经验 获得超4个赞

我也认为绝对没有必要开始入侵OSX。


我能够解决它


brew install python

看来,使用新版El Capitan随附的python / pip会有一些问题。


查看完整回答
反对 回复 2019-12-10
?
慕神8447489

TA贡献1780条经验 获得超1个赞

正如其他答案所说,这是由于新的系统完整性保护,但我认为其他答案过于复杂。


如果您只想在当前用户中使用该软件包,则应该可以使用该--user标志安装它,而无需禁用SIP 。像这样:


sudo pip install --user packagename


查看完整回答
反对 回复 2019-12-10
  • 3 回答
  • 0 关注
  • 393 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信