readbeyond / aeneas

aeneas is a Python/C library and a set of tools to automagically synchronize audio and text (aka forced alignment)
http://www.readbeyond.it/aeneas/
GNU Affero General Public License v3.0
2.45k stars 218 forks source link

Cannot find -lespeak #229

Closed Kailegh closed 4 years ago

Kailegh commented 5 years ago

Hi, I am using Ubuntu 18.04
I have followed these installation instructions :

If you have another Linux distribution, just make sure you have ffmpeg, ffprobe (usually provided by the ffmpeg package), and espeak installed and available on your command line. You also need Python and its development package containing the C headers (python-dev or similar).

All of them are accesible from command line, epeag, ffmpeg... But I keep getting this error, /home/user/anaconda3/envs/DeepSpeech/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lespeak

I have even used the install_dependencies.sh script and it installs everything without errors. And I have tried manual installation too:

$ git clone https://github.com/ReadBeyond/aeneas.git
$ cd aeneas
$ sudo pip install -r requirements.txt
$ python setup.py build_ext --inplace
$ python aeneas_check_setup.py

Nothing works and I keep getting the same error /home/user/anaconda3/envs/DeepSpeech/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lespeak

Does anybody knows what might be going on?

Thanks a lot

pettarin commented 5 years ago

ld: cannot find -lespeak

means that pip tries to compile the cew C extension, but the linker is not able to locate the espeak lib.

You need to install these first:

sudo apt-get install -y espeak espeak-data libespeak1 libespeak-dev

BTW, for Debian/Ubuntu, the repo provides a Bash script:

https://raw.githubusercontent.com/readbeyond/aeneas/master/install_dependencies.sh

See also similar resolved issue: https://github.com/readbeyond/aeneas/issues/210

Best regards,

Alberto Pettarin

On 4/2/19 10:42 AM, Kailegh wrote:

Hi, I am using Ubuntu 18.04 I have followed these installation instructions :

  • https://github.com/readbeyond/aeneas/blob/master/wiki/INSTALL.md I have installed everything required:

    If you have another Linux distribution, just make sure you have ffmpeg, ffprobe (usually provided by the ffmpeg package), and espeak installed and available on your command line. You also need Python and its development package containing the C headers (python-dev or similar).

All of them are accesible from command line, epeag, ffmpeg... But I keep getting this error, |/home/user/anaconda3/envs/DeepSpeech/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lespeak|

I have even used the |install_dependencies.sh| script and it installs everything without errors. And I have tried manual installation too:

|$ git clone https://github.com/ReadBeyond/aeneas.git $ cd aeneas $ sudo pip install -r requirements.txt $ python setup.py build_ext --inplace $ python aeneas_check_setup.py |

Nothing works and I keep getting the same error |/home/user/anaconda3/envs/DeepSpeech/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lespeak|

Does anybody knows what might be going on?

Thanks a lot

Kailegh commented 5 years ago

Thanks for the response, I have tried sudo apt-get install -y espeak espeak-data libespeak1 libespeak-dev but I have everything already installed. In my question I posted that I have already run the install_dependencies.sh script successfully, I can run espeak from the console. The problem is when I run pip install aeneas I still get: cannot find -lespeak. But as I said I think I have everything installed and I have successfully run install_dependencies.sh

readbeyond commented 5 years ago

I see, my bad, I got only the "manual setup" part.

Well, I think the problem is due to the fact your are running inside (ana)conda, and its version of ld is not able to find the libespeak header when pip compiles the cew C extension. Unfortunately I do not know much about (ana)conda to give precise advise.

I suspect that you might just need to run ldconfig and/or set the LD_LIBRARY_PATH before/while doing the "pip install aeneas" command --- but I do not know for sure. It might also be due to a mix of packages from Ubuntu and from (ana)conda, like e.g.:

https://github.com/pytorch/translate/issues/48

One thing you can try is: creating a virtualenv from the python that comes with ubuntu, activate it, and try install aeneas there. Or, alternatively, you need to figure how to make the "ld" that comes with conda aware of the libespeak header file. (Again, not sure how you can achieve that.)

HTH,

AP

On 4/3/19 9:33 AM, Kailegh wrote:

Thanks for the response, I have tried |sudo apt-get install -y espeak espeak-data libespeak1 libespeak-dev | but I have everything already installed. In my question I posted that I have already run the |install_dependencies.sh| script successfully, I can run espeak from the console. The problem is when I run pip install aeneas I still get: cannot find -lespeak. But as I said I think I have everything installed and I have successfully run install_dependencies.sh

ahmetkamilacar commented 4 years ago

I have the exact problem with ld not being able to find -lespeak. But I do not use anaconda. I followed the installing instructions via pip3 to the letter. Here's the crucial part of my output:

building 'aeneas.cew.cew' extension C compiler: x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC creating build/temp.linux-x86_64-3.6/aeneas/cew compile options: '-I['/usr/local/lib/python3.6/dist-packages/numpy/core/include'] -I/usr/include/python3.6m -c' x86_64-linux-gnu-gcc: aeneas/cew/cew_py.c x86_64-linux-gnu-gcc: aeneas/cew/cew_func.c x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/aeneas/cew/cew_py.o build/temp.linux-x86_64-3.6/aeneas/cew/cew_func.o -lespeak -o build/lib.linux-x86_64-3.6/aeneas/cew/cew.cpython-36m-x86_64-linux-gnu.so

/usr/bin/ld: cannot find -lespeak
collect2: error: ld returned 1 exit status

error: Command "x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/aeneas/cew/cew_py.o build/temp.linux-x86_64-3.6/aeneas/cew/cew_func.o -lespeak -o build/lib.linux-x86_64-3.6/aeneas/cew/cew.cpython-36m-x86_64-linux-gnu.so" failed with exit status 1

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-4q9jo1r3/aeneas/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-rfracjoq-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-4q9jo1r3/aeneas/

My specs:

Ubuntu 18.04.2 Lts Python 3.6.8 python-dev pip 9.0.1 for Python 3.6 numpy 1.17.0 ffmpeg ffprobe 3.4.6 eSpeak text-to-speech: 1.48.03

ahmetkamilacar commented 4 years ago

JUST FOUND A SOLUTION!:

https://github.com/readbeyond/aeneas/issues/189

sudo apt-get install libespeak-dev

should do the trick...

nmstoker commented 4 years ago

There may be a smarter / less hacky way of doing this, but I found a way round this after lots of fruitless searching.

I had the same issue with espeak and libespeak.so being installed, and I was using conda (as the OP).

My method was to find the location of libespeak.so (it was in /usr/lib for me) and then create a symbolic link within the conda environment's lib directory:

ln -s /usr/lib/libespeak.so /home/neil/.conda/envs/transcription/lib/libespeak.so

Once that was done, pip install aeneas worked fine.

pettarin commented 4 years ago

OK, thanks. I will update the docs in the next release.