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
Closed

Errors installing on OS X #2

pkerpedjiev opened this issue May 28, 2017 · 11 comments

Comments

@pkerpedjiev
Copy link
Collaborator

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
Copy link
Collaborator Author

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
Copy link

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

@nvictus
Copy link
Owner

nvictus commented Nov 25, 2017

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

@nvictus
Copy link
Owner

nvictus commented Nov 25, 2017

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

@nvictus
Copy link
Owner

nvictus 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
Copy link

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

@nvictus
Copy link
Owner

nvictus 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
Copy link
Owner

nvictus 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
Copy link

@nvictus Works for me now

@nvictus nvictus closed this as completed Mar 16, 2018
@snikumbh
Copy link

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
Copy link

jakevc 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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants