libespeak1 librabry

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

libespeak1 librabry

2,541 Views
Mohan51
Contributor II

I am trying to convert text to speech using "pyttsx3" python library on imx93 processor.but getting this error.

Error:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/pyttsx3/__init__.py", line 20, in init
    eng = _activeEngines[driverName]
          ~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib/python3.11/weakref.py", line 136, in __getitem__
    o = self.data[key]()
        ~~~~~~~~~^^^^^
KeyError: None

 

During handling of the above exception, another exception occurred:

 

Traceback (most recent call last):
  File "/home/root/padle/text_ocr.py", line 46, in <module>
    text_to_speech(extracted_text)
  File "/home/root/padle/text_ocr.py", line 24, in text_to_speech
    engine = pyttsx3.init()
             ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pyttsx3/__init__.py", line 22, in init
    eng = Engine(driverName, debug)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pyttsx3/engine.py", line 30, in __init__
    self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pyttsx3/driver.py", line 50, in __init__
    self._module = importlib.import_module(name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.11/site-packages/pyttsx3/drivers/espeak.py", line 9, in <module>
    from . import _espeak, toUtf8, fromUtf8
  File "/usr/lib/python3.11/site-packages/pyttsx3/drivers/_espeak.py", line 18, in <module>
    dll = cdll.LoadLibrary('libespeak.so.1')
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ctypes/__init__.py", line 454, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ctypes/__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: libespeak.so.1: cannot open shared object file: No such file or directory

-------------------------------------------------------------------------------------------------------------

root@imx93evk:~/padle# sudo apt-get install libespeak1
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package libespeak1

0 Kudos
Reply
5 Replies

2,496 Views
Mohan51
Contributor II

I flashed the latest BSP from nxp embedded Linux images.but unable to find local.conf in the image folder

0 Kudos
Reply

2,480 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @Mohan51! 

The local.conf is on Yocto Project, you have to compile the image adding the packages that you need on the rootfs.

 

Best Regards!

Chavira

0 Kudos
Reply

2,502 Views
Mohan51
Contributor II

Hi @Chavira I installed using  pip3 only but still getting the error

0 Kudos
Reply

2,515 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @Mohan51!

Thank you for contacting NXP Support!

 

Try using pip3 for that purpose.

 

pip3 install pyttsx3

 

https://pypi.org/project/pyttsx3/

 

Best Regards!

Chavira

0 Kudos
Reply

2,498 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @Mohan51!

 

If the problem persists you have to compile a new image adding the library in the local.conf of the yocto project.

 

Please follow the Yocto Users Guide.

 https://www.nxp.com/docs/en/user-guide/IMX_YOCTO_PROJECT_USERS_GUIDE.pdf

Best Regards!

Chavira

0 Kudos
Reply