新手 pyspider all 启动不起来

发布于 2022-09-11 16:28:28 字数 4190 浏览 18 评论 0

问题描述

windows平台 启动安装时出现
`C:pythonPython37Scripts>pip3 install pyspider
Requirement already satisfied: pyspider in c:pythonpython37libsite-packages (0.3.10)
Requirement already satisfied: Flask>=0.10 in c:pythonpython37libsite-packages (from pyspider) (1.0.2)
Requirement already satisfied: Jinja2>=2.7 in c:pythonpython37libsite-packages (from pyspider) (2.10)
Requirement already satisfied: chardet>=2.2 in c:pythonpython37libsite-packages (from pyspider) (3.0.4)
Requirement already satisfied: cssselect>=0.9 in c:pythonpython37libsite-packages (from pyspider) (1.0.3)
Requirement already satisfied: lxml in c:pythonpython37libsite-packages (from pyspider) (4.2.5)
Requirement already satisfied: pycurl in c:pythonpython37libsite-packages (from pyspider) (7.43.1)
Requirement already satisfied: requests>=2.2 in c:pythonpython37libsite-packages (from pyspider) (2.20.1)
Requirement already satisfied: Flask-Login>=0.2.11 in c:pythonpython37libsite-packages (from pyspider) (0.4.1)
Requirement already satisfied: u-msgpack-python>=1.6 in c:pythonpython37libsite-packages (from pyspider) (2.5.0)
Requirement already satisfied: click>=3.3 in c:pythonpython37libsite-packages (from pyspider) (7.0)
Requirement already satisfied: six>=1.5.0 in c:pythonpython37libsite-packages (from pyspider) (1.11.0)
Requirement already satisfied: tblib>=1.3.0 in c:pythonpython37libsite-packages (from pyspider) (1.3.2)
Requirement already satisfied: wsgidav>=2.0.0 in c:pythonpython37libsite-packages (from pyspider) (2.4.1)
Requirement already satisfied: tornado<=4.5.3,>=3.2 in c:pythonpython37libsite-packages (from pyspider) (4.5.3)
Requirement already satisfied: pyquery in c:usershereappdataroamingpythonpython37site-packages (from pyspider) (1.4.0)
Requirement already satisfied: itsdangerous>=0.24 in c:pythonpython37libsite-packages (from Flask>=0.10->pyspider) (1.1.0)
Requirement already satisfied: Werkzeug>=0.14 in c:pythonpython37libsite-packages (from Flask>=0.10->pyspider) (0.14.1)
Requirement already satisfied: MarkupSafe>=0.23 in c:pythonpython37libsite-packages (from Jinja2>=2.7->pyspider) (1.1.0)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in c:pythonpython37libsite-packages (from requests>=2.2->pyspider) (1.24.1)
Requirement already satisfied: certifi>=2017.4.17 in c:pythonpython37libsite-packages (from requests>=2.2->pyspider) (2018.10.15)
Requirement already satisfied: idna<2.8,>=2.5 in c:pythonpython37libsite-packages (from requests>=2.2->pyspider) (2.7)
Requirement already satisfied: PyYAML in c:pythonpython37libsite-packages (from wsgidav>=2.0.0->pyspider) (3.13)
Requirement already satisfied: defusedxml in c:pythonpython37libsite-packages (from wsgidav>=2.0.0->pyspider) (0.5.0)
Requirement already satisfied: jsmin in c:pythonpython37libsite-packages (from wsgidav>=2.0.0->pyspider) (2.2.2)`

相关代码

// 请把代码文本粘贴到下方(请勿用图片代替代码)
C:Usershere>pyspider all
Traceback (most recent call last):
File "C:PythonPython37Scriptspyspider-script.py", line 11, in <module>

load_entry_point('pyspider==0.3.10', 'console_scripts', 'pyspider')()

File "c:pythonpython37libsite-packagespkg_resources__init__.py", line 480, in load_entry_point

return get_distribution(dist).load_entry_point(group, name)

File "c:pythonpython37libsite-packagespkg_resources__init__.py", line 2693, in load_entry_point

return ep.load()

File "c:pythonpython37libsite-packagespkg_resources__init__.py", line 2324, in load

return self.resolve()

File "c:pythonpython37libsite-packagespkg_resources__init__.py", line 2330, in resolve

module = __import__(self.module_name, fromlist=['__name__'], level=0)

File "c:pythonpython37libsite-packagespyspiderrun.py", line 231

async=True, get_object=False, no_input=False):
    ^

SyntaxError: invalid syntax

这个是出了什么问题啊

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

岁月流歌 2022-09-18 16:28:28

语法错误,你看看async的用法

心如荒岛 2022-09-18 16:28:28

async在python3.7中已经变为保留关键字了

鹿港小镇 2022-09-18 16:28:28

原因是python3.7中async已经变成了关键字。因此出现这个错误。
修改方式是手动替换一下

下面位置的async改为mark_async

/usr/local/lib/python3.7/site-packages/pyspider/run.py  的231行、245行(两个)、365行

/usr/local/lib/python3.7/site-packages/pyspider/webui/app.py 的95行

/usr/local/lib/python3.7/site-packages/pyspider/fetcher/tornado_fetcher.py 的81行、89行(两个)、95行、117行

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文