安装chatterbot时出现依赖错误

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

我正在尝试使用 Python 创建一个聊天机器人。当我运行“pip3 install chatterbot”时,出现错误

错误:preshed<2.1.0,>=2.0.1 的一些构建依赖项 https://files.pythonhosted.org/packages/0b/14/c9aa735cb9c131545fc9e23031baccb87041ac9215b3d75f99e3cf18f6a3/preshed-2.0.1.tar.gz 与后端依赖项冲突:wheel==0.42.0 不兼容 带轮>=0.32.0,<0.33.0.

查询 ChatGPT,它表明由“preshed”依赖项指定的“wheel”包的版本约束导致了问题。它建议我首先通过运行“pip install preshed==2.0.1”来安装“preshed”,然后重试安装chatterbot,但我仍然遇到相同的错误。 我什至创建了一个虚拟环境并将其安装在那里,但我遇到了同样的错误。我该如何解决这个问题?

这是我的点子列表

Package    Version
---------- ----------
certifi    2023.11.17
cymem      2.0.8
murmurhash 1.0.10
pip        23.3.2

我安装了 python3 3.12.1。

这是完整的错误

Collecting chatterbot
  Using cached ChatterBot-1.0.5-py2.py3-none-any.whl (67 kB)
Collecting mathparse<0.2,>=0.1 (from chatterbot)
  Using cached mathparse-0.1.2-py3-none-any.whl (7.2 kB)
Collecting nltk<4.0,>=3.2 (from chatterbot)
  Using cached nltk-3.8.1-py3-none-any.whl (1.5 MB)
Collecting pint>=0.8.1 (from chatterbot)
  Using cached Pint-0.23-py3-none-any.whl.metadata (8.1 kB)
Collecting pymongo<4.0,>=3.3 (from chatterbot)
  Using cached pymongo-3.13.0.tar.gz (804 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting python-dateutil<2.8,>=2.7 (from chatterbot)
  Using cached python_dateutil-2.7.5-py2.py3-none-any.whl (225 kB)
Collecting pyyaml<5.2,>=5.1 (from chatterbot)
  Using cached PyYAML-5.1.2.tar.gz (265 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting spacy<2.2,>=2.1 (from chatterbot)
  Using cached spacy-2.1.9.tar.gz (30.7 MB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      Collecting setuptools
        Using cached setuptools-69.0.2-py3-none-any.whl.metadata (6.3 kB)
      Collecting wheel<0.33.0,>0.32.0
        Using cached wheel-0.32.3-py2.py3-none-any.whl (21 kB)
      Collecting Cython
        Using cached Cython-3.0.6-cp312-cp312-macosx_10_9_x86_64.whl.metadata (3.2 kB)
      Collecting cymem<2.1.0,>=2.0.2
        Using cached cymem-2.0.8-cp312-cp312-macosx_10_9_x86_64.whl.metadata (8.4 kB)
      Collecting preshed<2.1.0,>=2.0.1
        Using cached preshed-2.0.1.tar.gz (113 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
      ERROR: Some build dependencies for preshed<2.1.0,>=2.0.1 from https://files.pythonhosted.org/packages/0b/14/c9aa735cb9c131545fc9e23031baccb87041ac9215b3d75f99e3cf18f6a3/preshed-2.0.1.tar.gz conflict with the backend dependencies: wheel==0.42.0 is incompatible with wheel>=0.32.0,<0.33.0.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies 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.

谢谢。

python python-3.x chatbot chatterbot
1个回答
0
投票

我使用 Anaconda 和 jupyter 笔记本。 尝试在Anaconda Navigator中创建一个新环境,并选择安装python版本3.7.16。

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