I am making a pyttsx3 chat bot however this error occurred:
OSError: libespeak.so.1: cannot open shared object file: No such file or directory
This error also occurred:
KeyError: None
Here is my code:
import pyttsx3
def say(sp):
engine = pyttsx3.init()
engine.say(sp)
engine.runandwait()
say("Hello my name is Neuron")
Does anyone know how I can fix this?
To install espeak on ubuntu or any of the debian based OS, enter the following command on the terminal:
sudo apt install espeak
To use pyttsx3 python library, install the following using terminal:
pip3 install pyttsx3
sudo apt install espeak
pip3 install pyaudio
or use
sudo apt install python3-pyaudio
I face the same problem on my ubuntu 20.04 at first install espeak or libespeak-dev
$ sudo apt install espeak
or
$ sudo apt install libespeak-dev
and after installing pyttsx3 on my venv
$ pip install pyttsx3
and it works fine with me hope it will help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With