Skip to content

Make Python/Numpy include paths configurable #187

Description

@hannes-brt

The Mac OS X Numpy and Python include paths are hard-coded to /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include and /usr/include/python2.7. I am on OS X 10.11 and I use the Anaconda Python distribution (installed to /Users/<user>/anaconda).

Currently, Bazel doesn't find my headers:

./tensorflow/python/client/tf_session_helper.h:4:10: fatal error: 'Python.h' file not found
#include <Python.h>
         ^
1 error generated.

It would be great if Python include paths could be configured in configure along with the cuDNN and CUDA paths.

Activity

  1. self-assigned this
    on Nov 13, 2015
  2. tscheepers commented on Nov 17, 2015

    @tscheepers

    I just ran into the same problem. A configuration would be great. Just for now I solved this by editing https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/BUILD#L23 and add your Python / Numpy include paths, e.g. for OS X "-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7"

  3. vrv commented on Dec 3, 2015

    @vrv

    bf6b536 added the ability to configure the python paths -- as a consequence, we require users to now run ./configure before invoking bazel so they can specify the paths.

    Let us know if this works for you!

  4. added a commit that references this issue on Nov 19, 2019
    e7cc025
  5. added a commit that references this issue on Dec 6, 2019
  6. added a commit that references this issue on Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions