Errors installing on OS X
pkerpedjiev opened this issue ยท 11 comments
When running python setup.py install
on OS X, I get the following errors:
pngwrite.c:7:10: fatal error: 'png.h' file not found
or
udc.c:39:10: fatal error: 'openssl/sha.h' file not found
Fixed by setting the C_INCLUDE_PATH
and LIBRARY_PATH
environment variables to point to the locations of these headers and libraries, respectively:
export C_INCLUDE_PATH="/usr/local/lib:/usr/local/include/libpng16:/usr/local/opt/openssl/include"
export LIBRARY_PATH="/usr/local/lib:/usr/local/include/libpng:/usr/local/opt/openssl/include"
@nvictus Would be great to mention this somewhere on the readme (maybe at the end under a trouble shooting section)
I guess the lesson is that libpng and openssl are also requirements.
I assume the required paths being at /usr/local/include
and /usr/local/opt
is specific to homebrew.
Was the LIBRARY_PATH
update even necessary? Also if libpng
symlinks to libpng16
then it would be more robust to just use libpng
.
Not sure, I've only tested with both exports being available. And yes /usr/local/opt/openssl/include
is related to homebrew.
Ok, so this happened to me now, and on Ubuntu, and even after installing libpng
and openssl
with conda (rather than via apt). The header files are just in a non-obvious place and it's not just homebrew's misbehavior. We might be able to handle this in most cases by adding sys.prefix + '/libpng16'
and sys.prefix + '/openssl'
to the include directories in setup.py
.
d9304f7 hopefully does the trick. No need to set the env vars manually. Could @pkerpedjiev or @flekschas test on a mac?
I just wished to report that I also faced this problem for openssl/sha.h
on debian using linuxbrew. Setting the C_INCLUDE_PATH
did the job for me. Thanks.
On MacOS 10.14.4 I had this same issue pip installing a package that depended on pybbi, I did a brew install libpng
, and that fixed it.