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

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

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

Loading

@flekschas
Copy link

@flekschas flekschas commented Nov 25, 2017

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

Loading

@nvictus
Copy link
Owner

@nvictus nvictus commented Nov 25, 2017

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

Loading

@nvictus
Copy link
Owner

@nvictus nvictus commented Nov 25, 2017

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

Loading

@nvictus
Copy link
Owner

@nvictus 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.

Loading

@flekschas
Copy link

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

Loading

@nvictus
Copy link
Owner

@nvictus 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.

Loading

@nvictus nvictus reopened this Nov 28, 2017
@nvictus
Copy link
Owner

@nvictus 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?

Loading

@flekschas
Copy link

@flekschas flekschas commented Mar 16, 2018

@nvictus Works for me now

Loading

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

@snikumbh snikumbh 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.

Loading

@jakevc
Copy link

@jakevc 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.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants