website: Add information on `Can't find a working Python installation` error to website FAQ
This issue is being opened as a reminder to add information about troubleshooting the Can't find a working Python installation error to the gem5 website's FAQ.
Related issue: https://github.com/gem5/gem5/issues/2305
Currently I faced with this problem on MacOS and Python 3.10/3.13 inside Conda.
scons comes from env's pip: pip install scons
python3-config Usage: /opt/anaconda3/envs/gem5/bin/python3-config [--prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed]
But all seems well on my main enviroments (no any virtual) and installing scons from brew:
scons build/ALL/gem5.opt -j 4
scons: Reading SConscript files ...
Mkdir("/Users/user/gem5-25.0.0.1/build/ALL/gem5.build")
Checking for linker -Wl,--as-needed support... no
Checking for compiler -Wno-c99-designator support... yes
Checking for compiler -Wno-defaulted-function-deleted support... yes
Checking for compiler -gz support... yes
Checking for linker -gz support... yes
Info: Using Python config: python3-config
Checking for C header file Python.h... yes
Checking Python version... 3.13.7
Checking for accept(0,0,0) in C++ library None... yes
Checking for zlibVersion() in C++ library z... yes
Checking for C library tcmalloc_minimal... no
Checking for C library tcmalloc... no
Warning: You can get a 12% performance improvement by installing tcmalloc (libgoogle-perftools-dev package on Ubuntu or RedHat).
Building in /Users/user/gem5-25.0.0.1/build/ALL
"build_tools/kconfig_base.py" "/Users/user/gem5-25.0.
Checking for pkg-config package protobuf... (cached) yes
Checking for C header file capstone/capstone.h... (cached) no
Warning: Header file <capstone/capstone.h> not found.
This host has no capstone library installed.
Checking for C header file linux/kvm.h... (cached) no
Warning: Info: Compatible header file <linux/kvm.h> not found, disabling KVM support.
Checking for C header file linux/if_tun.h... (cached) no
Info: Compatible header file <linux/if_tun.h> not found.
Checking for backtrace_symbols_fd((void *)1, 0, 0) in C library None... (cached) yes
Checking for C header file fenv.h... (cached) yes
Checking for C header file png.h... (cached) no
Warning: Header file <png.h> not found.
This host has no libpng library.
Disabling support for PNG framebuffers.
Checking for clock_nanosleep(0,0,NULL,NULL) in C library None... (cached) no
Checking for clock_nanosleep(0,0,NULL,NULL) in C library rt... (cached) no
Warning: Can't find library for POSIX clocks.
Checking for C header file valgrind/valgrind.h... (cached) no
Checking for pkg-config package hdf5-serial... (cached) no
Checking for pkg-config package hdf5... (cached) yes
Checking for H5Fcreate("", 0, 0, 0) in C library hdf5... (cached) yes
Checking for H5::H5File("", 0) in C++ library hdf5_cpp... (cached) yes
Checking for shm_open("/test", 0, 0) in C library None... (cached) yes
Warning: Cannot enable KVM, host seems to lack KVM support
Checking whether __i386__ is declared... (cached) no
Checking whether __x86_64__ is declared... (cached) no
Warning: Unrecognized architecture for systemc.
So, there still some warning such as:
*** Summary of Warnings ***
Warning: You can get a 12% performance improvement by installing tcmalloc (libgoogle-perftools-dev package on Ubuntu or RedHat).
Warning: Header file <capstone/capstone.h> not found.
This host has no capstone library installed.
Warning: Info: Compatible header file <linux/kvm.h> not found, disabling KVM support.
Warning: Header file <png.h> not found.
This host has no libpng library.
Disabling support for PNG framebuffers.
Warning: Can't find library for POSIX clocks.
Warning: Cannot enable KVM, host seems to lack KVM support
But brew install pkg-config capstone libpng gperftools says all are there:
Warning: pkgconf 2.5.1 is already installed and up-to-date.
To reinstall 2.5.1, run:
brew reinstall pkgconf
Warning: capstone 5.0.6 is already installed and up-to-date.
To reinstall 5.0.6, run:
brew reinstall capstone
Warning: libpng 1.6.50 is already installed and up-to-date.
To reinstall 1.6.50, run:
brew reinstall libpng
Warning: gperftools 2.17.2 is already installed and up-to-date.
To reinstall 2.17.2, run:
brew reinstall gperftools
And they really exists:
user@Mac gem5-25.0.0.1 % file /opt/homebrew/include/capstone/capstone.h
/opt/homebrew/include/capstone/capstone.h: c program text, ASCII text
user@Mac gem5-25.0.0.1 % file /opt/homebrew/include/png.h
/opt/homebrew/include/png.h: ASCII text
I met the same problem.
[#56#wangx@wangxiang:gem5[学习] $ scons build/ALL/gem5.opt -j9
scons: Reading SConscript files ...
Mkdir("/home/wangx/github/other/gem5/build/ALL/gem5.build")
Checking for linker -Wl,--as-needed support... yes
Checking for compiler -gz support... yes
Checking for linker -gz support... yes
Info: Using Python config: python3-config
Checking for C header file Python.h... yes
terminate called after throwing an instance of 'std::runtime_error' what():
Failed to import the site module Aborted (core dumped)
Checking Python version... no
Error: Can't find a working Python installation
here the scons was installed by python venv. after uninstall python venv, the build works.