【问题标题】:ERROR: Cannot install en-core-web-trf because these package versions have conflicting dependencies错误:无法安装 en-core-web-trf,因为这些软件包版本具有冲突的依赖项
【发布时间】:2022-01-15 21:13:05
【问题描述】:

我使用以下命令(来自 spacy 网站 here)在 Windows 10 home 64 位下安装 spacy 和 en_core_web_trf,但是,我在运行最后(第三行)命令时遇到了问题。

pip install -U pip setuptools wheel
pip install -U spacy
python -m spacy download en_core_web_trf

错误:

INFO: pip is looking at multiple versions of en-core-web-trf to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install en-core-web-trf because these package versions have conflicting dependencies.

The conflict is caused by:
    spacy-transformers 1.1.4 depends on torch>=1.6.0
    spacy-transformers 1.1.3 depends on torch>=1.6.0
    spacy-transformers 1.1.2 depends on torch>=1.6.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

有人知道怎么解决吗?谢谢!我整个晚上都被困在这里。

卸载spacy并使用pip install spacy-transformers -f https://download.pytorch.org/whl/torch_stable.html重新安装后更新出错

ERROR: Cannot install spacy-transformers==0.5.0, spacy-transformers==0.5.1, spacy-transformers==0.5.2, spacy-transformers==0.5.3, spacy-transformers==0.6.1, spacy-transformers==0.6.2, spacy-transformers==1.0.0, spacy-transformers==1.0.1, spacy-transformers==1.0.2, spacy-transformers==1.0.3, spacy-transformers==1.0.4, spacy-transformers==1.0.5, spacy-transformers==1.0.6, spacy-transformers==1.1.0, spacy-transformers==1.1.1, spacy-transformers==1.1.2, spacy-transformers==1.1.3 and spacy-transformers==1.1.4 because these package versions have conflicting dependencies.

The conflict is caused by:
    spacy-transformers 1.1.4 depends on torch>=1.6.0
    spacy-transformers 1.1.3 depends on torch>=1.6.0
    spacy-transformers 1.1.2 depends on torch>=1.6.0
    spacy-transformers 1.1.1 depends on torch>=1.6.0
    spacy-transformers 1.1.0 depends on torch>=1.6.0
    spacy-transformers 1.0.6 depends on torch>=1.5.0
    spacy-transformers 1.0.5 depends on torch>=1.5.0
    spacy-transformers 1.0.4 depends on torch>=1.5.0
    spacy-transformers 1.0.3 depends on torch>=1.5.0
    spacy-transformers 1.0.2 depends on torch>=1.5.0
    spacy-transformers 1.0.1 depends on torch>=1.5.0
    spacy-transformers 1.0.0 depends on torch>=1.5.0
    spacy-transformers 0.6.2 depends on spacy<2.4.0 and >=2.3.0
    spacy-transformers 0.6.1 depends on spacy<2.4.0 and >=2.3.0
    spacy-transformers 0.5.3 depends on spacy<2.3.0 and >=2.2.1
    spacy-transformers 0.5.2 depends on spacy<2.3.0 and >=2.2.1
    spacy-transformers 0.5.1 depends on spacy<2.3.0 and >=2.2.1
    spacy-transformers 0.5.0 depends on spacy<2.3.0 and >=2.2.1

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

【问题讨论】:

    标签: python pip nlp spacy


    【解决方案1】:

    试试:
    pip uninstall spacy-transformers 1.1.4
    pip uninstall spacy-transformers 1.1.3
    pip uninstall spacy-transformers 1.1.2
    然后执行:

    pip install spacy-transformers -f https://download.pytorch.org/whl/torch_stable.html
    

    您可以在https://pypi.org/project/spacy-transformers/找到完整的安装过程

    【讨论】:

    • 谢谢,使用 pip 卸载后,我收到警告:警告:跳过 spacy-transformers,因为它没有安装。
    • 对不起,使用pip uninstall spacy 然后pip install spacy-transformers -f https://download.pytorch.org/whl/torch_stable.html
    • 谢谢,但为什么呢?卸载spacy后,我需要重新安装它,对吗?因为我的目的是安装它
    • 是,但使用第二个命令
    • 感谢您的建议,不幸的是,它不起作用,我又遇到了类似的错误,请参阅更新的错误,谢谢
    【解决方案2】:

    与我有同样问题的人的信息。

    提到的问题终于没有解决,至少我尝试重新安装包,重新安装python(重新安装之前完全卸载它)。没有什么对我有用。

    我最终是如何避免这种情况的?

    我完全卸载了python。

    安装Anaconda(最新版本),在安装Anaconda的同时,pip和python也默认安装。然后我在windows命令行中使用pip install XX,不管是安装spacy,还是安装requirements.txt,都运行良好。这就是我避免上述问题的方法。

    希望对同样有此问题的人有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-16
      • 2021-12-06
      • 2021-01-06
      • 2023-02-12
      • 2023-01-02
      • 1970-01-01
      • 2016-07-29
      • 2016-07-29
      相关资源
      最近更新 更多