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

Errors installing on OS X #2

Closed
pkerpedjiev opened this issue May 28, 2017 · 11 comments

Comments

@pkerpedjiev
Copy link
Collaborator

commented May 28, 2017

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
@pkerpedjiev

This comment has been minimized.

Copy link
Collaborator Author

commented May 28, 2017

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"
@flekschas

This comment has been minimized.

Copy link

commented Nov 25, 2017

@nvictus Would be great to mention this somewhere on the readme (maybe at the end under a trouble shooting section)

@nvictus

This comment has been minimized.

Copy link
Owner

commented Nov 25, 2017

I guess the lesson is that libpng and openssl are also requirements.

@nvictus

This comment has been minimized.

Copy link
Owner

commented Nov 25, 2017

I assume the required paths being at /usr/local/include and /usr/local/opt is specific to homebrew.

@nvictus

This comment has been minimized.

Copy link
Owner

commented Nov 25, 2017

Was the LIBRARY_PATH update even necessary? Also if libpng symlinks to libpng16 then it would be more robust to just use libpng.

@flekschas

This comment has been minimized.

Copy link

commented Nov 26, 2017

Not sure, I've only tested with both exports being available. And yes /usr/local/opt/openssl/include is related to homebrew.

@nvictus

This comment has been minimized.

Copy link
Owner

commented Nov 28, 2017

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.

@nvictus nvictus reopened this Nov 28, 2017

@nvictus

This comment has been minimized.

Copy link
Owner

commented Nov 28, 2017

d9304f7 hopefully does the trick. No need to set the env vars manually. Could @pkerpedjiev or @flekschas test on a mac?

@flekschas

This comment has been minimized.

Copy link

commented Mar 16, 2018

@nvictus Works for me now

@nvictus nvictus closed this Mar 16, 2018

@snikumbh

This comment has been minimized.

Copy link

commented Apr 27, 2018

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.

@jakevc

This comment has been minimized.

Copy link

commented Apr 10, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.