安装 Spacy 2.3.5 时出现错误消息 - 即使已经安装了构建工具,“需要 Microsoft Visual C++ 14.0 或更高版本”

问题描述 投票:0回答:1

我想使用 spacy 2.3.5 版本,因为我在这个版本中训练了一个 NLP 模型。 我可以使用“pip install spacy”安装最新的 spacy

但是安装任何特定版本都会失败

>>pip install spacy==2.3.5

  copying spacy\tests\tokenizer\sun.txt -> build\lib.win-amd64-cpython-310\spacy\tests\tokenizer
  running build_ext
  building 'spacy.parts_of_speech' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/   
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.   ERROR: Failed building wheel for spacy Failed to build spacy ERROR: Could not build wheels for spacy, which is required to install pyproject.toml-based projects

我的系统中存在构建工具:

我已经多次尝试重新安装 pip、构建工具并重新启动系统。我的环境变量 PATH 中不存在构建工具,因此我添加了该路径,但 Spacy 安装失败。

如果这看起来像是一个重复的问题,我深表歉意,但我已经在 Stackoverflow 上查看了解决方案,但没有任何效果。

这个答案建议安装第三部分轮子,但网页不可用。

我的环境信息: Python 3.10.10 上的虚拟环境 Windows 10 家庭版

python python-3.x pip build-tools
1个回答
0
投票

spacy 2.3.5
"2.3.1", "2.3.0"

兼容
"2.3.5": {
      "en_core_web_sm": ["2.3.1", "2.3.0"],
      "en_core_web_md": ["2.3.1", "2.3.0"],
      "en_core_web_lg": ["2.3.1", "2.3.0"]
}

您可以通过以下方式安装:

pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz

或者

pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.0/en_core_web_sm-2.3.0.tar.gz

这是完整的链接:https://github.com/explosion/spacy-models/blob/master/compatibility.json

© www.soinside.com 2019 - 2024. All rights reserved.