Problem with pythonlibs

Hello,
I’m trying to compile ROOT, on a CentOs machine, to run pyroot on python3. I already did the same operation on other distros in the past with no problem.
When i try to do:
cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.6 ../root-6.18.04/
I get:

-- Found PythonInterp: /usr/bin/python3.6 (found version "3.6.8") 
-- Found PythonLibs: /usr/lib64/libpython2.7.so (found version "2.7.5") 
CMake Error at cmake/modules/SearchInstalledSoftware.cmake:444 (message):
  Version mismatch between Python interpreter (3.6.8) and libraries (2.7.5).

  ROOT cannot work with this configuration.  Please specify only
  PYTHON_EXECUTABLE to CMake with an absolute path to ensure matching
  versions are found.
Call Stack (most recent call first):-- Found PythonInterp: /usr/bin/python3.6 (found version "3.6.8") 
-- Found PythonLibs: /usr/lib64/libpython3.6m.so.1.0 (found version "2.7.5") 
CMake Error at cmake/modules/SearchInstalledSoftware.cmake:444 (message):
  Version mismatch between Python interpreter (3.6.8) and libraries (2.7.5).


  CMakeLists.txt:159 (include)


No problem, dear CMake, I can specify also the pythonlibs path -If i try:
cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.6 -DPYTHON_LIBRARY=/usr/lib64/libpython3.6m.so.1.0 ../root-6.18.04/'
The result is:


-- Looking for python
-- Found PythonInterp: /usr/bin/python3.6 (found version "3.6.8") 
-- Found PythonLibs: /usr/lib64/libpython3.6m.so.1.0 (found version "2.7.5") 
CMake Error at cmake/modules/SearchInstalledSoftware.cmake:444 (message):
  Version mismatch between Python interpreter (3.6.8) and libraries (2.7.5).

Which is quite nonsense for me…
If I try to specify also the header location:
cmake -Dpython=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_LIBRARY=/usr/lib64/libpython3.6m.so.1.0 -DPYTHON_INCLUDE_DIR=/usr/include/python3.6m/ ../root-6.18.04/'

Maybe it’s worst:


-- Found PythonInterp: /usr/bin/python3 (found version "3.6.8") 
-- Found PythonLibs: /usr/lib64/libpython3.6m.so.1.0  
CMake Error at cmake/modules/SearchInstalledSoftware.cmake:444 (message):
  Version mismatch between Python interpreter (3.6.8) and libraries ().

I removed “CMakeCache.txt” at every step.
I’m out of ideas, can someone help me?

Thanks,
Alberto

I solved the problem installing again python3.6 with yum from the Software Collection. The installation is in another directory and pointing executable and library to this directory I was able to build.
I don’t think I will ever know what was wrong with the first python3.6 installation (which is working fine beside ROOT compilation).
Thanks anyway.
Alberto

Hi Alberto,
welcome to the ROOT forum! I’m glad to hear you found a solution. @maxgalli or @etejedor might have an idea of what was wrong with the previous setup.

Cheers,
Enrico

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.