Google Colab 无法构建 spacy 轮

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

我正在尝试在 Google Colab 中安装 spacy,但是其他类似问题中的解决方案都不适合我。

这是我尝试的(我也尝试添加

--no-cache-dir
):

!pip install spacy==2.3.7

这是输出:

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting spacy==2.3.7
  Downloading spacy-2.3.7.tar.gz (5.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.8/5.8 MB 30.6 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.10/dist-packages (from spacy==2.3.7) (1.0.9)
Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.10/dist-packages (from spacy==2.3.7) (2.0.7)
Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.10/dist-packages (from spacy==2.3.7) (3.0.8)
Collecting thinc<7.5.0,>=7.4.1 (from spacy==2.3.7)
  Downloading thinc-7.4.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 195.9 MB/s eta 0:00:00
Requirement already satisfied: blis<0.8.0,>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from spacy==2.3.7) (0.7.9)
Collecting wasabi<1.1.0,>=0.4.0 (from spacy==2.3.7)
  Downloading wasabi-0.10.1-py3-none-any.whl (26 kB)
Collecting srsly<1.1.0,>=1.0.2 (from spacy==2.3.7)
  Downloading srsly-1.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (209 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 209.8/209.8 kB 158.4 MB/s eta 0:00:00
Collecting catalogue<1.1.0,>=0.0.7 (from spacy==2.3.7)
  Downloading catalogue-1.0.2-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /usr/local/lib/python3.10/dist-packages (from spacy==2.3.7) (4.65.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.10/dist-packages (from spacy==2.3.7) (67.7.2)
Requirement already satisfied: numpy>=1.15.0 in /usr/local/lib/python3.10/dist-packages (from spacy==2.3.7) (1.22.4)
Collecting plac<1.2.0,>=0.9.6 (from spacy==2.3.7)
  Downloading plac-1.1.3-py2.py3-none-any.whl (20 kB)
Requirement already satisfied: requests<3.0.0,>=2.13.0 in /usr/local/lib/python3.10/dist-packages (from spacy==2.3.7) (2.27.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy==2.3.7) (1.26.15)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy==2.3.7) (2022.12.7)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy==2.3.7) (2.0.12)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3.0.0,>=2.13.0->spacy==2.3.7) (3.4)
Building wheels for collected packages: spacy
  error: subprocess-exited-with-error
  
  × Building wheel for spacy (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Building wheel for spacy (pyproject.toml) ... error
  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

预先感谢您的帮助!

python pip google-colaboratory spacy
1个回答
0
投票

谷歌 Colab 说:

Google Colab 在 Python 3.10 上运行。我们在 /usr/local 现有的发行版之上安装 Miniconda 发行版,添加一些配置文件,以便我们继续使用 Python 3.10,并且新安装的软件包可用。

不幸的是,

spacy 2.3.7
可以在python 3.9之前正常运行(pip有二进制轮子)

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