简体   繁体   中英

How do I get cmake to find python3.9 instead of python3.10 on ubuntu22.04

Python3.10 breaks a lot of python scripts and it's the default on Ubuntu22.04. I have a cmake script that keeps on picking up Python3.10 when I have Python3.9 installed (even when python3.9 is set as default on my system) how do I make cmake find python3.9 using command line options? Location would be /usr/bin/python3.9 or /usr/bin/python

How did you search for python in your CMakeLists.txt ?

If using the built-in module FindPython3 you should be able to control the python used using -DPython3_ROOT_DIR="your_python3.9_install_dir"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM