question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gTTS not wanting to import properly

See original GitHub issue

So I am trying to get gTTS to work I know that you are supposed to import with from gtts import gTTS. I have a new virtualenv, with gtts, and speechrecognition installed and no matter what I do I can’t get gTTS to import If I try: from gtts import gTTS ImportError: cannot import name 'gTTS' Any ideas? Using Python 3.5.2

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:23

github_iconTop GitHub Comments

3reactions
jhoelzlcommented, Nov 9, 2016

Maybe this is related to http://stackoverflow.com/questions/16981921/relative-imports-in-python-3. What is the name of your script file? It should no be gtts.py.

Maybe try something like this:

import gtts

tts = gtts.tts.gTTS(text='Hello', lang='en')
tts.save("hello.mp3")

or remove the dots in the import command in __init__.py

2reactions
RohitKumar2511commented, Sep 25, 2019

Brother, @ajayprajapat171, when I can’t find out what’s the error is… I just unistalled and reinstalled… finally error got solved

Read more comments on GitHub >

github_iconTop Results From Across the Web

"from gtts import gTTS" works fine in python 2.7 but it does not ...
Now, on a new PC (a raspberry) I wanted to start using the python3 (3.5.3) so I tried and it didn't work. As...
Read more >
Cant install gtts module Python 3.4 [SOLVED]
Successfully installed gtts. Cleaning up. ... If I start a python shell and try and import gtts , the module is not found: ......
Read more >
python 3 - ImportError with Google Text-to-Speech(gTTs)
I have to use 3.8 for my project I am working on. ` I entered in from gtts import gTTs. when I do...
Read more >
Module not found: No module named gtts : r/learnpython
Module not found: No module named gtts. Hi im trying to import gTTS and have succsesfully installed it in the command promt.
Read more >
Solved I have issues importing gTTs. how can I go about it.
This is my code from gtts import gtts import os import sys #file copying into text.. with open(sys.argv[0],"r") as file: inputread = file.read()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found