解决Mac安装scrapy失败的问题
今天打算弄个爬虫,想来想去打算用python弄一个。之前了解到scrapy这个库是个不错的选择,于是开始折腾。可惜第一步就挂了。
安装scrapy库就不成功:
Installingcollectedpackages:six,w3lib,parsel,pyasn1,pyasn1-modules,attrs,service-identity,scrapy Foundexistinginstallation:six1.4.1 DEPRECATION:Uninstallingadistutilsinstalledproject(six)hasbeendeprecatedandwillberemovedinafutureversion.Thisisduetothefactthatuninstallingadistutilsprojectwillonlypartiallyuninstalltheproject. Uninstallingsix-1.4.1: Exception: Traceback(mostrecentcalllast): File"/Library/Python/2.7/site-packages/pip/basecommand.py",line215,inmain status=self.run(options,args) File"/Library/Python/2.7/site-packages/pip/commands/install.py",line342,inrun prefix=options.prefix_path, File"/Library/Python/2.7/site-packages/pip/req/req_set.py",line778,ininstall requirement.uninstall(auto_confirm=True) File"/Library/Python/2.7/site-packages/pip/req/req_install.py",line754,inuninstall paths_to_remove.remove(auto_confirm) File"/Library/Python/2.7/site-packages/pip/req/req_uninstall.py",line115,inremove renames(path,new_path) File"/Library/Python/2.7/site-packages/pip/utils/__init__.py",line267,inrenames shutil.move(old,new) File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",line302,inmove copy2(src,real_dst) File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",line131,incopy2 copystat(src,dst) File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",line103,incopystat os.chflags(dst,st.st_flags) OSError:[Errno1]Operationnotpermitted:'/var/folders/r9/35q9g3d56_d9g0v59w9x2l9w0000gn/T/pip-oWMyqW-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
果断google+stackoverflow。
结论是:
http://stackoverflow.com/questions/31900008/oserror-errno-1-operation-not-permitted-when-installing-scrapy-in-osx-10-11
brewinstallpython
原因是旧的python版本在新的mac系统上有些问题。升级一下就好了。
以上这篇解决Mac安装scrapy失败的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持毛票票。