Python Version
TanDro opened this issue · comments
The following code
pymoskito/pymoskito/binding_modules.py
Lines 139 to 143 in 2730d9a
leads to the following error
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find Python: Found unsuitable version "3.8", but required is
exact version "3.8.10" (found _Python_EXECUTABLE-NOTFOUND)
during compilation in Ubuntu like setups (Ubuntu, Wsl) and with a Windows Visual Studio setup.
I have had good experience with
c_make_lists += "set (Python_FIND_VIRTUALENV STANDARD)\n"
c_make_lists += "find_package(Python REQUIRED " \
"COMPONENTS Interpreter Development)\n\n"
Hey,
I introduced that rather strict version checking since CMake in the CI tests always managed to find the wrong one.
It seems like the behavior changed over various CMake versions, with v3.20 in the CI or v3.21.1 on my machine its working.
What happens if you only get rid of the `EXACT' keyword but keep the version in there?
Hey,
I have found a variant that works on all platforms I can test on.
c_make_lists += "set (Python_FIND_VIRTUALENV STANDARD)\n"
c_make_lists += "find_package(Python {}.{} EXACT REQUIRED " \
"COMPONENTS Interpreter Development)\n\n" \
"".format(sys.version_info[0], sys.version_info[1])
A very nice solution. The CI toolchain seems to like it: https://github.com/cklb/pymoskito/actions/runs/1147487003.
Please report back if the issue can be closed.
All right, I tested it on three other machines and it worked fine. I close the issue.