欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

pip install pyspider失败的解决办法

程序员文章站 2023-09-28 21:39:10
报错 下载pycurl库 地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/ pycurl 选择对应的python版本 安装pycurl库 pip install 文件名 安装pyspider库 换源安装pyspider: 安装成功 此时运行pyspider ......

报错

pip install pyspider失败的解决办法


下载pycurl库

地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycurl

选择对应的python版本

pip install pyspider失败的解决办法


安装pycurl库

pip install 文件名

pip install pyspider失败的解决办法


安装pyspider库

换源安装pyspiderpip install pyspider -i https://pypi.doubanio.com/simple

pip install pyspider失败的解决办法

安装成功

pip install pyspider失败的解决办法


此时运行pyspider还会报错
  • 因为 pyspider 的作者在参数中用了async关键字
  • python 3.5中引入了async和await,它们在python 3.7中成为关键字

pip install pyspider失败的解决办法


修改pyspider里的async关键字

到python安装目录下,找到这三个文件,ctrl + h ,将里面的 async 替换为任何非关键字以外的参数,比如 async123,然后保存

  • lib\site-packages\pyspider\run.py
  • lib\site-packages\pyspider\webui\app.py
  • lib\site-packages\pyspider\fetcher\tornado_fetcher.py(这个文件里的async记得区分大小写)

如果忘记安装目录,可以用pip --version查看

pip install pyspider失败的解决办法


最后修改一个文件,解决这个问题:deprecated option 'domaincontroller': use 'http_authenticator.domain_controller' instead.

  • lib\site-packages\pyspider\webui\webdav.py
将209行的
'domaincontroller': needauthcontroller(app),

修改为
'http_authenticator': {
        'httpauthenticator': needauthcontroller(app),
    },

修改前

pip install pyspider失败的解决办法

修改后

pip install pyspider失败的解决办法


大功告成

pip install pyspider失败的解决办法

浏览器打开localhost:5000

pip install pyspider失败的解决办法