Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Espeak Backend error in Docker tmp folder #178

Open
Ahmed-Hossam-Aldeen opened this issue Oct 2, 2024 · 3 comments
Open

Espeak Backend error in Docker tmp folder #178

Ahmed-Hossam-Aldeen opened this issue Oct 2, 2024 · 3 comments

Comments

@Ahmed-Hossam-Aldeen
Copy link

Describe the bug
I Installed phonemizer and espeak in docker container by
$ pip install phonemizer
$ apt-get update && apt-get upgrade -y
$ apt-get install espeak

When I try to run any function related to phonemizer, the following error message appears.

Exception ignored in: <finalize object at 0x7f08c6529a20; dead>
Traceback (most recent call last):
File "/opt/conda/envs/lee/lib/python3.8/weakref.py", line 566, in call
return info.func(*info.args, **(info.kwargs or {}))
File "/opt/conda/envs/lee/lib/python3.8/site-packages/phonemizer/backend/espeak/api.py", line 116, in _delete
shutil.rmtree(tempdir)
File "/opt/conda/envs/lee/lib/python3.8/shutil.py", line 722, in rmtree
onerror(os.rmdir, path, sys.exc_info())
File "/opt/conda/envs/lee/lib/python3.8/shutil.py", line 720, in rmtree
os.rmdir(path)
OSError: [Errno 39] Directory not empty: '/tmp/tmpw4cld8sd'
And Some files pile up in /tmp folder.

Phonemizer version
phonemizer-3.0.1
available backends: espeak-1.48.3, segments-2.2.0
uninstalled backends: espeak-mbrola, festival

System
Ubuntu 20.04

To reproduce
$ phonemize --version

Expected behavior
tmp/tmp[~~] folder is deleted without error message

Additional context
Is it a file delete permission issue?

@mmmaat
Copy link
Collaborator

mmmaat commented Oct 2, 2024

Hi, I guess you are using a base docker image like "anaconda" or "miniconda"? In those images, the user has restricted privileges. Try to define the environment variable TMPDIR to a path where you have rw permission.

You can try something like TMPDIR=$HOME echo "hello" | phonemize -b espeak -l en-us

@Ahmed-Hossam-Aldeen
Copy link
Author

Thank you, I have created a temp directory for espeak in root, so now TMPDIR=/root/tmp_espeak and it now works using this command echo "hello" | phonemize -b espeak -l en-us from terminal, but when I use espeak backend from python phonemes = phonemize(text, language='en-us', backend='espeak', strip=True, preserve_punctuation=True, with_stress=True) I get the same error again error OSError: [Errno 39] Directory not empty: '/home/model-server/tmp/tmp9q8e_44b'

@mmmaat
Copy link
Collaborator

mmmaat commented Oct 2, 2024

this is not clear to me, you created /root/tmp_espeak but the error is about /home/model-server/tmp. From Python do you have TMPDIR defined in os.environ? You should, and it must point to a folder where the user running Python have read/write permission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants