1adrianb / face-alignment

:fire: 2D and 3D Face alignment library build using pytorch
https://www.adrianbulat.com
BSD 3-Clause "New" or "Revised" License
6.94k stars 1.33k forks source link

imagecodecs openjpeg.h: No such file or directory #172

Closed gerrito333 closed 4 years ago

gerrito333 commented 4 years ago

When I run pip3 install face-alignment I get the following error:

imagecodecs/_jpeg2k.c:602:10: fatal error: openjpeg.h: No such file or directory
 #include "openjpeg.h"
          ^~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for imagecodecs
1adrianb commented 4 years ago

If you are on ubuntu try running sudo apt-get install -y libopenjpeg-dev beforehand.

gerrito333 commented 4 years ago

Thanks for your prompt reply. Tried, but I am unable to find this package:

apt-get install -y libopenjpeg-dev E: Unable to locate package libopenjpeg-dev

1adrianb commented 4 years ago

Try installing then libopenjp2-7-dev please

gerrito333 commented 4 years ago

With libopenjp2-7-dev installed, I still get this message:

imagecodecs/_jpeg2k.c:602:10: fatal error: openjpeg.h: No such file or directory
 #include "openjpeg.h"
          ^~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I am using a ubuntu18.04 docker image, I will try if switching to ubuntu16.04 helps.

1adrianb commented 4 years ago

That shouldn't be a problem to be honest. Try to see if you can locate where the header is and manually add if its necessary. For an example see https://github.com/python-pillow/Pillow/issues/2387#issuecomment-276072748

gerrito333 commented 4 years ago

Using a ubuntu16.04 with libopenjpeg-dev and other libs mentioned on https://pypi.org/project/imagecodecs/ solved it. Thanks Adrian for you support.