The Makefile-based build of the C++ binding uses python3-config to determine the location of (amongst other things) the Python shared libraries.
If the user is working in a Python virtual environment created using venv, it appears that the environment does not typically contain a link to an appropriate python3-config executable in its bin directory. When the build runs, the Makefile will fall back to whatever python3-config is available in the system installation of Python, which can be a completely different version of Python without the correct packages.
This has been tried and fixes the problem, but is not really an optimal solution. The project README implies that a virtual environment should work correctly, but most likely only works coincidentally because the system version of Python may have all of the correct packages installed anyway.
The Makefile-based build of the C++ binding uses
python3-config
to determine the location of (amongst other things) the Python shared libraries.If the user is working in a Python virtual environment created using
venv
, it appears that the environment does not typically contain a link to an appropriatepython3-config
executable in itsbin
directory. When the build runs, the Makefile will fall back to whateverpython3-config
is available in the system installation of Python, which can be a completely different version of Python without the correct packages.A workaround is for the user to manually add a
python3-config
script to the virtual environment, along the lines of this post: https://stackoverflow.com/questions/42020937/why-pyvenv-does-not-install-python-configThis has been tried and fixes the problem, but is not really an optimal solution. The project README implies that a virtual environment should work correctly, but most likely only works coincidentally because the system version of Python may have all of the correct packages installed anyway.