Python3.7安装pyspider框架的坑
总所周知,Python爬虫有两个很出名的框架,Scrapy与pyspider。
在Python3.7版本中安装时
Traceback (most recent call last):
File "/ffk_learn/software/Python-3.7.0/ffk_py/bin/pyspider", line 7, in <module>
from pyspider.run import main
File "/ffk_learn/software/Python-3.7.0/ffk_py/lib/python3.7/site-packages/pyspider/run.py", line 231
async=True, get_object=False, no_input=False):
^
SyntaxError: invalid syntax
报错!!!
是因为在python3.7版本,async这个变量名不能使用!!!
所以解决的办法:
- 将Python降版本至3.5
- 将Python中的两个文件夹中的这两个文件的async改名为async_mode
-
1 ffk_py/lib/python3.7/site-packages/pyspider/run.py
-
2 ffk_py/lib/python3.7/site-packages/pyspider/fetcher/tornado_fetcher.py