使用pip install安装TTS库,报“ERROR: Could not build wheels for tts, which is required to install pyproject”

问题描述

使用pip install安装TTS库,报“ERROR: Could not build wheels for tts, which is required to install pyproject”错误,尝试了各种方法失败
命令:

pip install TTS -i https://pypi.tuna.tsinghua.edu.cn/simple

结果:

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for TTS
Failed to build TTS
ERROR: Could not build wheels for TTS, which is required to install pyproject.toml-based projects

[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: python.exe -m pip install --upgrade pip

解决办法

于是尝试下载安装包TTS-0.11.1.tar.gz,在本地安装,pypi.org
解压后,如下:
在这里插入图片描述
使用CMD,进入到上面的路径,运行:python setup.py install, 不成功!

D:\TTS-0.11.1>python setup.py install
Traceback (most recent call last):
  File "D:\TTS-0.11.1\setup.py", line 26, in <module>
    from packaging.version import Version
ModuleNotFoundError: No module named 'packaging'

注意:到安装路径下有requirements文件,换一种方式安装:

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

安装结果:

....
Successfully installed Babel-2.11.0 Jinja2-3.1.2 MarkupSafe-2.1.2 Werkzeug-2.2.3 anyascii-0.3.1 appdirs-1.4.4 audioread-3.0.0 certifi-2022.12.7 cffi-1.15.1 
charset-normalizer-3.0.1 click-8.1.3 colorama-0.4.6 contourpy-1.0.7 coqpit-0.0.17 cycler-0.11.0 cython-0.29.28 dateparser-1.1.7 decorator-5.1.1 docopt-0.6.2 
flask-2.2.3 fonttools-4.38.0 fsspec-2023.1.0 g2pkk-0.1.2 gruut-2.2.3 gruut-ipa-0.13.0 gruut_lang_de-2.0.0 gruut_lang_en-2.0.0 idna-3.4 inflect-5.6.0 
itsdangerous-2.1.2 jamo-0.4.1 jieba-0.42.1 joblib-1.2.0 jsonlines-1.2.0 kiwisolver-1.4.4 librosa-0.8.0 llvmlite-0.38.1 matplotlib-3.7.0 mecab-python3-1.0.5 
networkx-2.8.8 nltk-3.8.1 num2words-0.5.12 numba-0.55.2 numpy-1.22.4 pandas-1.5.3 pillow-9.4.0 pooch-1.6.0 protobuf-3.19.6 psutil-5.9.4 
pycparser-2.21 pynndescent-0.5.8 pyparsing-3.0.9 pypinyin-0.48.0 pysbd-0.3.4 python-crfsuite-0.9.9 python-dateutil-2.8.2 pytz-2022.7.1 pytz-deprecation-shim-0.1.0.post0 
pyyaml-6.0 regex-2022.10.31 requests-2.28.2 resampy-0.4.2 scikit-learn-1.2.1 scipy-1.10.1 six-1.16.0 soundfile-0.12.1 tensorboardX-2.6 threadpoolctl-3.1.0 
torch-1.13.1 torchaudio-0.13.1 tqdm-4.64.1 trainer-0.0.20 typing-extensions-4.5.0 tzdata-2022.7 tzlocal-4.2 umap-learn-0.5.1 unidic-lite-1.0.8 urllib3-1.26.14

再次运行python setup.py install,不成功,提示:Microsoft Visual C++ 14.0 or greater is required

...
building 'TTS.tts.utils.monotonic_align.core' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

按照提示,访问https://visualstudio.microsoft.com/visual-cpp-build-tools, 下载Microsoft C++ 生成工具并安装:
在这里插入图片描述
在这里插入图片描述
安装所需要的空间大约为7.5GB
安装完成后,再次运行python setup.py install,运行成功,结果如下:

...
Using c:\users\carino\appdata\local\programs\python\python310\lib\site-packages
Finished processing dependencies for TTS==0.11.1

使用pip list查看安装的库列表:
在这里插入图片描述
安装成功

  • 6
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
在执行命令"pip install gdal"时,出现了错误提示"ERROR: Could not build wheels for gdal, which is required to install pyproject.toml-based projects"。这个错误提示意味着无法为gdal构建wheels,而wheels安装基于pyproject.toml的项目所必需的。 通常,这个问题是由于缺少所需的构建工具或而导致的。要解决这个问题,您可以尝试以下几个步骤: 1. 确保您的系统上已经安装了gdal的依赖项和所需的构建工具。gdal可能需要一些本地和头文件来进行构建。您可以查看gdal的官方文档或使用适用于您的操作系统的包管理器来安装这些依赖项。 2. 确保您的Python环境已经正确配置并且与gdal的版本兼容。有时,版本不兼容可能会导致构建失败。您可以尝试升级或降级gdal的版本来解决这个问题。 3. 如果您使用的是Windows操作系统,您还可以尝试从预编译的二进制文件中安装gdal,而不是构建它。可以在gdal的官方网站上找到适用于Windows的二进制文件。 4. 如果以上步骤都没有解决问题,您还可以尝试在安装gdal之前升级或切换您的pip版本。有时,pip的版本也可能会导致构建失败。 总结来说,解决"ERROR: Could not build wheels for gdal, which is required to install pyproject.toml-based projects"错误的步骤包括:安装所需的依赖项和构建工具、配置正确的Python环境、尝试使用预编译的二进制文件安装gdal,升级或切换pip版本等。希望这些步骤能够帮助您解决问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [ERROR: Could not build wheels for XXX, which is required to install pyproject.toml-based projects](https://blog.csdn.net/longe20111104/article/details/131332169)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [ERROR: Could not build wheels for hdbscan, which is required to install pyproject.toml-based project](https://blog.csdn.net/huoshanshaohui/article/details/129468669)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [pyproject-devenv:使用pyproject.toml元数据创建虚拟环境](https://download.csdn.net/download/weixin_42110362/16820211)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值