问题描述
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__) =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.9win_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