gpt4 book ai didi

python - Scrapy startproject 给出奇怪的错误

转载 作者:太空宇宙 更新时间:2023-11-03 15:06:44 25 4
gpt4 key购买 nike

我几乎肯定这是因为 python2.7 与 python3.5 的问题,但我还没有找到修复它的方法。

我跑

    $ scrapy startproject test1

并得到这个错误:

    Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/bin/scrapy", line 9, in <module>
load_entry_point('Scrapy==1.0.1', 'console_scripts', 'scrapy')()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/scrapy/cmdline.py", line 122, in execute
cmds = _get_commands_dict(settings, inproject)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/scrapy/cmdline.py", line 46, in _get_commands_dict
cmds = _get_commands_from_module('scrapy.commands', inproject)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/scrapy/cmdline.py", line 29, in _get_commands_from_module
for cmd in _iter_command_classes(module):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site- packages/scrapy/cmdline.py", line 21, in _iter_command_classes
for obj in vars(module).itervalues():
AttributeError: 'dict' object has no attribute 'itervalues'

最佳答案

解决方法是:

sudo pip install scrapy==1.1.0rc1

Scrapy 现在可用于 Python3。

关于python - Scrapy startproject 给出奇怪的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31818609/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com