Conda安装requirements里面依赖出现ERROR: No matching distribution found for opencc==1.1.6

环境:

Python 3.11.5

Bert-VITS2.4

opencc 1.1.7

Conda 虚拟环境

问题描述:

Conda安装requirements里面依赖出现ERROR: No matching distribution found for opencc==1.1.6

ERROR: Ignored the following versions that require a different python version: 0.52.0 Requires-Python >=3.6,<3.9; 0.52.0rc3 Requires-Python >=3.6,<3.9; 0.53.0 Requires-Python >=3.6,<3.10; 0.53.0rc1.post1 Requires-Python >=3.6,<3.10; 0.53.0rc2 Requires-Python >=3.6,<3.10; 0.53.0rc3 Requires-Python >=3.6,<3.10; 0.53.1 Requires-Python >=3.6,<3.10; 0.54.0 Requires-Python >=3.7,<3.10; 0.54.0rc2 Requires-Python >=3.7,<3.10; 0.54.0rc3 Requires-Python >=3.7,<3.10; 0.54.1 Requires-Python >=3.7,<3.10; 0.55.0 Requires-Python >=3.7,<3.11; 0.55.0rc1 Requires-Python >=3.7,<3.11; 0.55.1 Requires-Python >=3.7,<3.11; 0.55.2 Requires-Python >=3.7,<3.11; 1.6.2 Requires-Python >=3.7,<3.10; 1.6.3 Requires-Python >=3.7,<3.10; 1.7.0 Requires-Python >=3.7,<3.10; 1.7.1 Requires-Python >=3.7,<3.10; 1.7.2 Requires-Python >=3.7,<3.11; 1.7.3 Requires-Python >=3.7,<3.11; 1.8.0 Requires-Python >=3.8,<3.11; 1.8.0rc1 Requires-Python >=3.8,<3.11; 1.8.0rc2 Requires-Python >=3.8,<3.11; 1.8.0rc3 Requires-Python >=3.8,<3.11; 1.8.0rc4 Requires-Python >=3.8,<3.11; 1.8.1 Requires-Python >=3.8,<3.11
ERROR: Could not find a version that satisfies the requirement opencc==1.1.6 (from versions: 0.1, 0.2, 1.1.0.post1, 1.1.1, 1.1.7)
ERROR: No matching distribution found for opencc==1.1.6

在这里插入图片描述

解决方案:

opencc1.16它支持 Python 3.9 及以下版本。对于 Python 3.11,可能还没有与之兼容的 OpenCC 版本可用。

需要在 Python 3.11 上使用 OpenCC,可以尝试以下解决方法

1.打开requirements把opencc== 1.16改成1.17保存文本
在这里插入图片描述
2.再次执行安装完成

 pip install -r requirements.txt

在这里插入图片描述在这里插入图片描述

3.还可以降级python版本

使用 Conda 创建了一个名为 "vits" 的 Python 环境,并且选择了 Python 3.11.5 版本,现在想回退到 Python 3.9,可以按照以下步骤进行操作:

    激活环境:打开命令提示符或终端,运行以下命令激活 "vits" 环境:

conda activate vits

移除环境:运行以下命令移除当前的 "vits" 环境(注意:这将删除该环境及其所有已安装的包):

conda env remove --name vits

创建新环境:运行以下命令创建一个新的 "vits" 环境,并选择 Python 3.9 版本:

conda create --name vits python=3.9

安装依赖包:如果你的项目有依赖包,可以在创建新环境后使用 Conda 或 pip 安装它们。例如:

conda install <package_name>

或

    pip install <package_name>

通过以上步骤,你应该能够从 Python 3.11.5 回退到 Python 3.9,并在新的 "vits" 环境中继续使用你的项目。请注意,在切换环境版本之前,请确保备份和保存好你需要的任何 Python 3.11.5 版本的代码、库和数据,以免丢失