我正在创建我自己的聊天机器人,因此我需要gTTS包,但我无法在windows上使用conda安装它,每次安装以失败告终。
我试过:conda安装gTTS
还有:conda安装-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.
官方蟒蛇云提供解决方案
conda install -c tdido gtts-token
参考网址:https://anaconda.org/tdido/gtts-token
这在Python3.4上工作
在anaconda网站上,它说gtts只能在Linux上下载,所以我认为你不能在视窗上使用gtts和conda。https://anaconda.org/tdido/gtts-token
您可以选择使用Linux或从pip安装。https://pypi.org/project/gTTS/
您可以在conda虚拟环境中安装pip。但是,同时使用pip和conda可能会导致问题,所以如果可能的话,最好创建一个新的conda虚拟环境来安装pip和gtts。
conda Create--name pip_env
source activate pip_env
的conda activate pip_env
打开它 conda install pip
安装pippip安装gtts
conda list
查找GTT李>关于康达与pip的信息: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