gpt4 book ai didi

python - 无法安装scrapy

转载 作者:太空宇宙 更新时间:2023-11-03 20:33:36 28 4
gpt4 key购买 nike

我正在使用 PyCharm 并想要创建一个 Hello World 项目。而且我无法安装 scrappy。

我尝试使用设置进行安装,但收到这些错误

Collecting Scrappy
Using cached https://files.pythonhosted.org/packages/b4/df/dcd763f44aea90fbd58b4e7f7c8be95ade7d130cd21251fc0d93c295b1f0/Scrappy-0.3.0.alpha.4.tar.gz
Collecting guessit (from Scrappy)
Using cached https://files.pythonhosted.org/packages/29/b4/fa5141d01f93191f9030a82e8528a6b8c5315059ea76e2e35d0cf3bef7f8/guessit-3.0.4.tar.gz
Collecting tvdb_api (from Scrappy)
Using cached https://files.pythonhosted.org/packages/ba/c5/abcff2dd75e63daae3466fffd05a28428e57828f8b878125571a8e8343a8/tvdb_api-2.0.tar.gz
Collecting hachoir-metadata (from Scrappy)
Using cached https://files.pythonhosted.org/packages/98/89/f31ba1431ed7627032338cd009eaeb65dfad1311fa1437107c406fcb025e/hachoir-metadata-1.3.3.tar.gz

ERROR: Command errored out with exit status 1:
command: 'C:\Users\Osman\AppData\Local\Programs\Python\Python37-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Osman\\AppData\\Local\\Temp\\pycharm-packaging\\hachoir-metadata\\setup.py'"'"'; __file__='"'"'C:\\Users\\Osman\\AppData\\Local\\Temp\\pycharm-packaging\\hachoir-metadata\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: C:\Users\Osman\AppData\Local\Temp\pycharm-packaging\hachoir-metadata\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Osman\AppData\Local\Temp\pycharm-packaging\hachoir-metadata\setup.py", line 65
except OSError, err:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

最佳答案

我也尝试安装Scrapy,我发现问题出在Twisted依赖库上,所以首先你必须安装Twisted(不太容易),来自this网站下载正确的预编译二进制文件(例如,如果您有 64 位 Windows 和 python 3.5,则必须在输入后从 cmd 下载 Twisted‑19.2.1‑cp35‑cp35m‑win_amd64.whl )二进制文件下载所在的文件夹:

python -m pip install  Twisted‑19.2.1‑cp35‑cp35m‑win_amd64.whl # change with your binary name

那么你应该轻松​​安装Scrapy

python -m pip install Scrapy

关于python - 无法安装scrapy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57317285/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com