解决 Pyspider 在 Windows 系统上安装报错的问题

21 篇文章 3 订阅

问题描述

Pyspider 在 Windows 系统上直接通过 pip install pyspider 安装报错:

 ERROR: Command errored out with exit status 10:
     command: 'C:\ProgramData\Miniconda3\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\87897\\AppData\\Local\\Temp\\pip-install-xihyzbcc\\pycurl_82ca8aa9b71a43bd9399542f724d2655\\setup.py'"'"'; __file__='"'"'C:\\Users\\87897\\AppData\\Local\\Temp\\pip-install-xihyzbcc\\pycurl_82ca8aa9b71a43bd9399542f724d2655\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\87897\AppData\Local\Temp\pip-pip-egg-info-8uato2i0'
         cwd: C:\Users\87897\AppData\Local\Temp\pip-install-xihyzbcc\pycurl_82ca8aa9b71a43bd9399542f724d2655\
    Complete output (5 lines):
    C:\Users\87897\AppData\Local\Temp\pip-install-xihyzbcc\pycurl_82ca8aa9b71a43bd9399542f724d2655\setup.py:957: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      if LooseVersion(distutils.__version__) > LooseVersion("1.0.1"):
    C:\Users\87897\AppData\Local\Temp\pip-install-xihyzbcc\pycurl_82ca8aa9b71a43bd9399542f724d2655\setup.py:959: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      if LooseVersion(distutils.__version__) < LooseVersion("1.0.3"):
    Please specify --curl-dir=/path/to/built/libcurl
ERROR: Cannot install pyspider==0.3.0, pyspider==0.3.1, pyspider==0.3.10, pyspider==0.3.2, pyspider==0.3.3, pyspider==0.3.4, pyspider==0.3.5, pyspider==0.3.6, pyspider==0.3.7, pyspider==0.3.8 and pyspider==0.3.9 because these package versions have conflicting dependencies.

The conflict is caused by:
    pyspider 0.3.10 depends on pycurl
    pyspider 0.3.9 depends on pycurl
    pyspider 0.3.8 depends on pycurl
    pyspider 0.3.7 depends on pycurl
    pyspider 0.3.6 depends on pycurl
    pyspider 0.3.5 depends on pycurl
    pyspider 0.3.4 depends on pycurl
    pyspider 0.3.3 depends on pycurl
    pyspider 0.3.2 depends on pycurl
    pyspider 0.3.1 depends on pycurl>=7.19
    pyspider 0.3.0 depends on pycurl>=7.19

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

解决方案

先安装 pycurl,从这里下载编译好的版本
在这里插入图片描述

  • 7.45.1:版本号
  • cp39:适用于 Python 3.9
  • win_amd64:Windows 64 位操作系统
  • win32:Windows 32 位操作系统

下载完成后,通过 pip install 安装

pip install pycurl‑7.45.1‑cp39‑cp39‑win_amd64.whl

最后,使用 pip install 直接安装 pyspider 就不会报错了

pip install spider
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Xavier Jiezou

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值