desbma / GoogleSpeech

Read text using Google Translate TTS API
GNU Lesser General Public License v2.1
161 stars 37 forks source link

Problem with example (sqlite3.ProgrammingError) #24

Closed pavvel1610 closed 3 years ago

pavvel1610 commented 3 years ago

Hello since about 5 days I have a problem with this library, it's not working at all. Some sqlite3 error is printed even for the simplest example. I've tried to reinstall the sqllite library but it didn't help. Anyone has the same error?

google_speech -l en "Hello $USER, it is $(date)" Traceback (most recent call last): File "/usr/bin/google_speech", line 11, in load_entry_point('google-speech==1.1.0', 'console_scripts', 'google_speech')() File "/usr/lib/python3.8/site-packages/google_speech/init.py", line 319, in cl_main speech.play(args.sox_effects) File "/usr/lib/python3.8/site-packages/google_speech/init.py", line 129, in play segments = list(self) File "/usr/lib/python3.8/site-packages/google_speech/init.py", line 89, in next yield SpeechSegment(segment, self.lang, segment_num, len(segments)) File "/usr/lib/python3.8/site-packages/google_speech/init.py", line 174, in init class.cache = web_cache.ThreadedWebCache(db_filepath, File "/usr/lib/python3.8/site-packages/web_cache/init.py", line 334, in init raise e File "/usr/lib/python3.8/site-packages/web_cache/init.py", line 374, in run cache_obj = WebCache(*args, **kwargs) File "/usr/lib/python3.8/site-packages/web_cache/init.py", line 75, in init self.connection.executescript("""PRAGMA journal_mode = MEMORY; sqlite3.DatabaseError: database disk image is malformed Exception ignored in: <function WebCache.del at 0x7f4b43395940> Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/web_cache/init.py", line 132, in del__ sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 139961225016896 and this is thread id 139961259226368.

desbma commented 3 years ago

sqlite3.DatabaseError: database disk image is malformed

Try removing the cache directory: rm -R ~/.cache/google_speech

pavvel1610 commented 3 years ago

@desbma Thank you a lot for the response, your solution worked for me. In the future when I will see such error I will be aware of it.

desbma commented 3 years ago

It should never happen in the normal case, that can only occur when the program or your computer crashes while it is writing to the cache file.

pavvel1610 commented 3 years ago

Now everything is clear, few days ago my OS crashed.