当我运行命令scrapy startproject教程时,我得到了很多错误,最后是AttributeError:' NoneType'对象没有属性' startswith'。在前面的行中,它指向各种文件中的各种行
c:\Python27>scrapy startproject tutorial
Traceback(most recent call last):
File "C:\Python32\Scripts\scrapy-script.py", line 9, in <module>
load_entry_point('Scrapy==0.24.4', 'console_scripts', 'scrapy')()
File "C:\Python32\lib\site-packages\pkg_resources\__init__.py", line 519, in load_entry_point
return get_distribution(dist).load_entry_point(group,name)
File "C:\Python32\lib\site-packages\pkg_resources\__init__.py", line 2630, in load_entry_point
return ep.load()
File "C:\Python32\lib\site-packages\pkg_resources\__init__.py", line 2310, in load
return self.resolve()
File "C:\Python32\lib\site-packages\pkg_resources\__init__.py",line 2316, in resolve
module=__import__(self.module_name, fromlist=['__name__'], level=0)
File "C:\Python32\lib\site-packages\scrapy\__init__.py", line 10, in <module>
__version__=pkgutil.get_data(__package__, 'VERSION').decode('ascii').strip()
File "C:\Python32\lin\pkgutil.py", line 565, in get_data
loader=get_loader(package)
File "C:\Python32\lib\pkgutil.py", line 453, in get_loader
return find_loader(fullname)
File "C:\Python32\lib\pkgutil.py", line 463, in find_loader
for importer in iter_importers(fullname):
File "C:\Python32\lib\pkgutil.py", line 413, in iter_importers
if fullname.startswith('.'):
AttributeError: 'NoneType'object has no attribute 'startswith'
答案 0 :(得分:0)
Scrapy does not support Python 3:
Scrapy支持哪些Python版本?支持Scrapy 仅限Python 2.7。从Scrapy开始,Python 2.6支持被删除 0.20。
Scrapy是否适用于Python 3?不,但有计划支持 Python 3.3+。目前,Scrapy适用于Python 2.7。
您需要使用Python 2.7。