首页 > 解决方案 > 安装twis​​ted时出错

问题描述

我正在尝试通过使用安装scrapy,pipenv install scrapy但是在安装依赖项时。它失败。

Installing scrapy…
Adding scrapy to Pipfile's [packages]…
Installation Succeeded
Installing dependencies from Pipfile.lock (ad2c1d)…
  ================================ 25/25 - 00:00:06
An error occurred while installing twisted==19.10.0 ; python_version >= '3.5'

我在虚拟环境中运行 python 3.8。使用 Pycharm 作为我的 IDE。

我最初认为也许我使用的是导致冲突的旧版本的 Python。

我的点子文件:

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
scrapy = "*"

[requires]
python_version = "3.8"

标签: pythonscrapytwisted

解决方案


安装 scrapy viapip很棘手,因为它是依赖项twisted并且lxml需要 C++ 编译器。


只有一种可靠且官方推荐的(docs)方法可以在 Windows 上安装它 - 使用 anaconda 发行版(不是pip


推荐阅读