我正在创建自己的聊天机器人,因此我需要gTTS软件包,但是每次安装失败均无法在Windows上使用conda进行安装。
我尝试过:
conda install gTTS
,以及:
康达install -c conda-forge gTTS
结果:
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- gtts
Current channels:
- https://conda.anaconda.org/conda-forge/win-64
- https://conda.anaconda.org/conda-forge/noarch
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/free/win-64
- https://repo.anaconda.com/pkgs/free/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- ....
- ....
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
答案 0 :(得分:0)
Anaconda官方云提供了解决方案
conda install -c tdido gtts-token
参考网址:https://anaconda.org/tdido/gtts-token
这适用于Python3.4
答案 1 :(得分:0)
在anaconda网站上,它说gtts仅可在Linux上下载,因此我认为您不能在Windows上将gtts与conda一起使用。 https://anaconda.org/tdido/gtts-token
您可以选择使用Linux或从pip安装。 https://pypi.org/project/gTTS/
您可以做的是在conda虚拟环境中安装pip。但是,同时使用pip和conda可能会引起问题,因此,如果可以安装pip和gtts,最好创建一个新的conda虚拟环境。
conda create --name pip_env
conda activate pip_env
中的source activate pip_env
打开它conda install pip
安装pip pip install gtts
conda list
查找gtts。有关使用pip的conda的信息:https://www.anaconda.com/blog/using-pip-in-a-conda-environment
有关在python中使用conda和pip管理软件包的信息:https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html
更详细地安装pip和其他pip模块:https://stackoverflow.com/a/43729857/14171363