我尝试为我一直在做的一个小项目安装gTTS(Google文本语音转换),但在安装gTTS时遇到错误。
(bot) Vishnus-iMac:bin Code$ pip install gTTS
Collecting gTTS
Installing collected packages: gTTS
Exception:
Traceback (most recent call last):
File "/Users/Code/virtualenvironment/bot/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/Users/Code/virtualenvironment/bot/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 366, in run
use_user_site=options.use_user_site,
File "/Users/Code/virtualenvironment/bot/lib/python2.7/site-packages/pip/_internal/req/__init__.py", line 49, in install_given_reqs
**kwargs
File "/Users/Code/virtualenvironment/bot/lib/python2.7/site-packages/pip/_internal/req/req_install.py", line 760, in install
use_user_site=use_user_site, pycompile=pycompile,
File "/Users/Code/virtualenvironment/bot/lib/python2.7/site-packages/pip/_internal/req/req_install.py", line 382, in move_wheel_files
warn_script_location=warn_script_location,
File "/Users/Code/virtualenvironment/bot/lib/python2.7/site-packages/pip/_internal/wheel.py", line 326, in move_wheel_files
assert info_dir, "%s .dist-info directory not found" % req
AssertionError: gTTS .dist-info directory not found
我该怎么办?
答案 0 :(得分:0)
该错误似乎与gTTS
无关,而与pip
有关。
尝试退出虚拟环境或通过pip
更新pip install pip -U
。然后尝试再次安装gTTs
。
答案 1 :(得分:0)
How can I solve installation error of gTTS?
可以完成以下步骤:
a)升级设置工具
pip3 install setuptools --upgrade
b)升级点子
pip3 install pip --upgrade
c)再次安装gtts,清除pip缓存
pip3 install --no-cache-dir gTTS
希望有帮助。