Imported target "pybind11::module" includes non-existent path

Issue #23 resolved
Matthew Parno created an issue

I’m trying to compile MUQ with python bindings in a Conda environment. When I run CMake, it seems to configure everything fine, but throws several errors when CMake tries to generate the documentation. In particular, I get several errors stating

CMake Error in CMakeLists.txt:

Imported target "pybind11::module" includes non-existent path

"/Users/mparno/opt/anaconda3/python.app/Contents/include/python3.8"

in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

How can I get around this?

Comments (1)

  1. Matthew Parno reporter

    This can sometimes happen when CMake doesn't find the right version of python. You can get past this issue by manually setting the path to the Python executable you want to use with pybind11 with the PYTHON_EXECUTABLE environment variable.

    For example, here is a CMake command setting the installation directory and specifying the python executable on a Mac:

    cmake -DCMAKE_INSTALL_PREFIX=~/Installations -DMUQ_USE_PYTHON=ON -DPYTHON_EXECUTABLE=~/opt/anaconda3/bin/python ../
    
  2. Log in to comment