-
Notifications
You must be signed in to change notification settings - Fork 8
Description
In the file CMakeFiles/target.dir/build.make created by CMake I have:
build/timestamp:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --blue --bold --progress-dir=/home/rec93639/Code/RALFit/libRALFit/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Generating build/timestamp"
/usr/bin/python3 -m pip install .
/usr/bin/cmake -E touch /home/rec93639/Code/RALFit/libRALFit/build/build/timestampAs /usr/bin/python3 is specified, this will always use the system-wide Python 3. However, on many Linux distributions (e.g. Ubuntu), the system-wide Python 3 is 'externally managed' meaning that Python packages cannot be installed via pip into the global environment. This means the compilation fails at this step.
The recommended solution for usual Python packages is to create a virtual environment and install the packages into them, but the compilation doesn't support this.
To reproduce: Attempt to build RALFit when the Python environment is externally managed.
Workaround: For now, I can make the package compile if I replace /usr/bin/python3 with [PATH TO MY VENV]/python3, but obviously this means I'm fiddling with files that I'm not supposed to manually edit!