ImportError: Python version mismatch: module was compiled for Python 3.6, but the interpreter version is incompatible: 3.9.19 (main, Mar 21 2024, 17:11:28)
修改include/pybind11/detail/common.h 文件的112-114行:
#include <Python.h>
#include <frameobject.h>
#include <pythread.h>
#include <python3.9/Python.h>
#include <python3.9/frameobject.h>
#include <python3.9/pythread.h>
python3.9为/usr/bin/ 中的环境变量,一般为自己的python版本号。