Skip to content

Errors installing on OS X #2

Closed
Closed

Description

@pkerpedjiev

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

Activity

  1. pkerpedjiev commented on May 28, 2017

    @pkerpedjiev
    CollaboratorAuthor

    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"
    
  2. flekschas commented on Nov 25, 2017

    @flekschas

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

  3. nvictus commented on Nov 25, 2017

    @nvictus
    Owner

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

  4. nvictus commented on Nov 25, 2017

    @nvictus
    Owner

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

  5. nvictus commented on Nov 25, 2017

    @nvictus
    Owner

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

  6. flekschas commented on Nov 26, 2017

    @flekschas

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

  7. nvictus commented on Nov 28, 2017

    @nvictus
    Owner

    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.

  8. nvictus commented on Nov 28, 2017

    @nvictus
    Owner

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

  9. flekschas commented on Mar 16, 2018

    @flekschas

    @nvictus Works for me now

  10. snikumbh commented on Apr 27, 2018

    @snikumbh

    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.

  11. jakevc commented on Apr 10, 2019

    @jakevc

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions