如何解决gTTS的安装错误?

时间:2019-01-02 10:48:42

标签: pip pycharm

AssertionError:安装gTTS时找不到gTTS .dist-info目录

(venv) D:\gui>pip install gTTS
Collecting gTTS
Installing collected packages: gTTS
Exception:
Traceback (most recent call last):
  File "d:\gui\venv\lib\site-packages\pip\_internal\cli\base_command.py", line 143, in main
    status = self.run(options, args)
  File "d:\gui\venv\lib\site-packages\pip\_internal\commands\install.py", line 366, in run
    use_user_site=options.use_user_site,
  File "d:\gui\venv\lib\site-packages\pip\_internal\req\__init__.py", line 49, in install_given_reqs
    **kwargs
  File "d:\gui\venv\lib\site-packages\pip\_internal\req\req_install.py", line 760, in install
    use_user_site=use_user_site, pycompile=pycompile,
  File "d:\gui\venv\lib\site-packages\pip\_internal\req\req_install.py", line 382, in move_wheel_files
    warn_script_location=warn_script_location,
  File "d:\gui\venv\lib\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

1 个答案:

答案 0 :(得分:1)

可以完成以下步骤:

a)升级设置工具

pip3 install setuptools --upgrade

b)升级点子

pip3 install pip --upgrade

c)再次安装gtts,清除pip缓存

pip3 install --no-cache-dir gTTS

希望有帮助。