我正在尝试通过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'
Run Code Online (Sandbox Code Playgroud)
我尝试使用以下命令停用OSX 10.11中的无根功能:
sudo nvram boot-args="rootless=0";sudo reboot
Run Code Online (Sandbox Code Playgroud)
但是当机器重新启动时我仍然会遇到同样的错误.
来自我的StackExchangers同事的任何线索或想法?
如果有帮助,则完整脚本输出如下:
sudo -s pip install scrapy
Collecting 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.whl
Collecting lxml (from scrapy) …Run Code Online (Sandbox Code Playgroud) 我sudo pip install -U nltk按照nltk文档的建议做了.但是,我得到以下输出:
Collecting nltk
Downloading nltk-3.0.5.tar.gz (1.0MB)
100% |????????????????????????????????| 1.0MB 516kB/s
Collecting six>=1.9.0 (from nltk)
Downloading six-1.9.0-py2.py3-none-any.whl
Installing collected packages: six, nltk
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) 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 six-1.4.1:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 211, in …Run Code Online (Sandbox Code Playgroud)