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

pyconfig.h: No such file or directory #10

Open
dprogm opened this issue Mar 1, 2022 · 3 comments
Open

pyconfig.h: No such file or directory #10

dprogm opened this issue Mar 1, 2022 · 3 comments

Comments

@dprogm
Copy link

dprogm commented Mar 1, 2022

Hello,
first thank you for providing this project. I have some problems in conjunction with pybind11. I am getting the following error when trying to build with a hermetic python:

In file included from external/pybind11/include/pybind11/detail/common.h:215:0,
from external/pybind11/include/pybind11/pytypes.h:12,
from external/pybind11/include/pybind11/cast.h:13,
from external/pybind11/include/pybind11/attr.h:13,
from external/pybind11/include/pybind11/pybind11.h:13,
from my_pb_mod.cc:1:
bazel-out/k8-fastbuild/bin/external/local_config_python/python_include/Python.h:8:10: fatal error: pyconfig.h: No such file or directory
#include "pyconfig.h"
^~~~~~~~~~~~
compilation terminated.

Do you know what can be the reason for this? Maybe this header is not exposed?

@kku1993
Copy link
Owner

kku1993 commented Mar 2, 2022

Glad to know you're finding this project helpful!

It would be helpful to know how you are building pybind. But if you're using the pybind11_bazel project, you should set the python_interpreter_target attr [1].

If you're building by hand, make sure you let the c compiler know where to find the headers. The headers should be under ${BUILD_DIR}/bazel_install/python3.8/include. In my example, I also expose it through a filegroup target [2].

[1] https://github.com/pybind/pybind11_bazel#hermetic-python
[2]

srcs = glob(["bazel_install/**"], exclude = ["**/* *"]),

@dprogm
Copy link
Author

dprogm commented Mar 8, 2022

I have set the python_interpreter_target to @python_interpreter//:python_bin. I have a minimal example here if you want to try it out. I am actually a little bit lost because I don't have the knowledge.

@kku1993
Copy link
Owner

kku1993 commented Apr 7, 2022

Hey sorry I didn't have time to look into this. I hope you've found a way around your issue?

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

2 participants