xeus-cling icon indicating copy to clipboard operation
xeus-cling copied to clipboard

fatal error: 'Python.h' file not found

Open pavelschon opened this issue 6 years ago • 1 comments

Using Jupyter+Cling and trying to build simple python extension:

In [1]: #include <Python.h>

        input_line_8:1:10: fatal error: 'Python.h' file not found
        #include <Python.h>
                 ^~~~~~~~~~

Workaround is to add the following lines to .bashrc:

export C_INCLUDE_PATH="~/miniconda3/include/python3.7m/"
export CPLUS_INCLUDE_PATH="~/miniconda3/include/python3.7m/"

However, I feel that this should work out-of-the-box without workaround.

This issue is created from https://github.com/ContinuumIO/anaconda-issues/issues/11430 since it's clearly not problem of Anaconda/Miniconda.

pavelschon avatar Nov 06 '19 21:11 pavelschon

Another solution:

#pragma cling add_include_path("$CONDA_PREFIX/include/python3.7m/")
#include <Python.h>

image

cauachagas avatar Jan 15 '20 20:01 cauachagas