【问题标题】:trouble to install spaCy 3.0 on GoogleColab在 Google Colab 上安装 spaCy 3.0 的麻烦
【发布时间】:2021-09-30 07:09:57
【问题描述】:

背景

我在以下本地环境中工作,需要在 GoogleColab 上使用 spaCy 3.0。

但是,由于 python 版本,在 3.0 之后安装 spaCy 似乎可以接受。

spaCy version    3.0.5                         
Python version   3.9.1  

错误

如何在 GoogleColab 3.0 之后使用 spaCy 还是现在无法使用?

Requirement already satisfied: spacy in /usr/local/lib/python3.7/dist-packages (2.2.4)
ERROR: Could not find a version that satisfies the requirement 3.0.5 (from versions: none)
ERROR: No matching distribution found for 3.0.5

环境

GoogleColab

!pip install spacy
!python -m spacy info
============================== Info about spaCy ==============================

spaCy version    2.2.4                         
Python version   3.7.11                                      

【问题讨论】:

    标签: python-3.x google-colaboratory spacy


    【解决方案1】:

    当你执行pip install XXX 时,pip 默认不会升级你已经安装的东西。要更新它,请使用-U(或--update)标志。

    pip install -U spacy
    

    这应该安装最新版本。

    【讨论】:

      【解决方案2】:

      您可以使用pip安装spaCy,并指定版本3.1.1

      !pip install spacy==3.1.1
      

      然后就可以查看结果了。

      import spacy
      print(spacy.__version__)  # 3.1.1
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-04-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多