Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot import name 'gTTS' from partially initialized module 'gtts'

Tags:

python

pypdf

gtts

ImportError: cannot import name 'gTTS' from partially initialized module 'gtts' (most likely due to a circular import) (C:\Users\Gayathri Sai\PycharmProjects\audibook\gtts.py)

like image 738
vcscharan Avatar asked Sep 14 '25 01:09

vcscharan


1 Answers

Looks like you're testing Google's Text-to-Speech and you innocently named your python file "gtts.py"(happened to me too). This conflicts with the import so you should rename your file to something else(e.g. test_gtts.py)

like image 63
Jacobski Avatar answered Sep 16 '25 15:09

Jacobski