今天需要爬虫安装scrapy 使用sudo sudo -s 始终报错,原因为six版本太低升级six完成安装,具体如下:「仅供参考」

Exception:

Traceback (most recent call last):

File “/Library/Python/2.7/site-packages/pip/basecommand.py”, line 209, in main

status = self.run(options, args)

File “/Library/Python/2.7/site-packages/pip/commands/install.py”, line 317, in run

prefix=options.prefix_path,

File “/Library/Python/2.7/site-packages/pip/req/req_set.py”, line 732, in install

**kwargs

File “/Library/Python/2.7/site-packages/pip/req/req_install.py”, line 835, in install

self.move_wheel_files(self.source_dir, root=root, prefix=prefix)

File “/Library/Python/2.7/site-packages/pip/req/req_install.py”, line 1030, in move_wheel_files

isolated=self.isolated,

File “/Library/Python/2.7/site-packages/pip/wheel.py”, line 344, in move_wheel_files

clobber(source, lib_dir, True)

File “/Library/Python/2.7/site-packages/pip/wheel.py”, line 322, in clobber

shutil.copyfile(srcfile, destfile)

File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py”, line 83, in copyfile

with open(dst, ‘wb’) as fdst:

IOError: [Errno 13] Permission denied: ‘/Library/Python/2.7/site-packages/six.py’ #升级six版本即可原版本太低

一开始以为是没有权限经过google搜索发现是six版本问题

第一次使用:

pip install –ignore-installed six

报错权限不足

然后使用:

sudo -s pip install –ignore-installed six

搞定!

然后使用 sudo -s pip install scrapy

问题解决参考:http://stackoverflow.com/questions/31900008/oserror-errno-1-operation-not-permitted-when-installing-scrapy-in-osx-10-11

github:https://github.com/pypa/pip/issues/3165

转自:http://www.bilibe.com/archives/265

文章来源于互联网,如有雷同请联系站长删除:MAC 安装 Scrapy 报错Permission denied

发表评论