ScottishCovidResponse / SCRCIssueTracking

Central issue tracking repository for all repos in the consortium
6 stars 0 forks source link

C++ binding Makefile build does not work correctly with venv #745

Open peter-t-fox opened 3 years ago

peter-t-fox commented 3 years ago

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.

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-config

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.

github-actions[bot] commented 3 years ago

Heads up @mrow84 @bobturneruk - the "data pipeline api" label was applied to this issue.