我想使用spacy 2.3.5版本,因为我在这个版本中训练了一个NLP模型. 我能够安装最新的spacy使用"pip安装spacy"

However installing any specific version fails

>>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

Build tools exists in my system: enter image description here

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

如果这看起来像一个重复的问题,我很抱歉,但我已经判断了Stackoverflow的解决方案,但都不起作用.

This answer建议安装third part wheels,但网页不可用.

My environment info: Python 3.10.10上的虚拟环境 Windows 10家庭版

推荐答案

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

以下是完整的链接:100

Python相关问答推荐

Python 3.12中的通用[T]类方法隐式类型检索

如何使用根据其他值相似的列从列表中获取的中间值填充空NaN数据

我想一列Panadas的Rashrame,这是一个URL,我保存为CSV,可以直接点击

将输入聚合到统一词典中

导入...从...混乱

启用/禁用shiny 的自动重新加载

Pandas GroupBy可以分成两个盒子吗?

* 动态地 * 修饰Python中的递归函数

在单次扫描中创建列表

在极中解析带有数字和SI前缀的字符串

python panda ExcelWriter切换动态公式到数组公式

找到相对于列表索引的当前最大值列表""

如何在Great Table中处理inf和nans

使用__json__的 pyramid 在客户端返回意外格式

如何使用正则表达式修改toml文件中指定字段中的参数值

如何求相邻对序列中元素 Select 的最小代价

如何在GEKKO中使用复共轭物

如何根据一定条件生成段id

高效地计算数字数组中三行上三个点之间的Angular

Scipy.linprog的可行性有问题吗?(A_ub@x0<;=b_ub).all()为True-但是-linprog(np.zeros_like(X0),A_ub=A_ub,b_ub=b_ub)不可行