Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile SofaPython3 with python 3.11 #428

Closed
aleblanc30 opened this issue Jul 18, 2024 · 1 comment
Closed

Cannot compile SofaPython3 with python 3.11 #428

aleblanc30 opened this issue Jul 18, 2024 · 1 comment

Comments

@aleblanc30
Copy link

aleblanc30 commented Jul 18, 2024

When compiling Sofa and SofaPython3 from sources on ubuntu 20.04, if python3.11 is installed, SofaPython3 will not compile.

The build fails with the following error : error: invalid use of incomplete type 'PyFrameObject' {aka 'struct _frame'}

A quick search online indicated that PyFrameObject disappeared in python3.11.

I could not find a cmake parameter to specify which python version to use. I assumed that the system detects the latest version, so I uninstalled python3.11 and compiled the project with python3.10 which solved the issue.

I wrote it down in case further action is needed.

@bakpaul
Copy link
Contributor

bakpaul commented Jul 19, 2024

Hello Alexandre !

This looks more like a pybind11 error than a python one. Can you check if the pybind11 lib that is used in your build is the one installed for python3.11 ? You can install pybind11 for your specific python version by calling python3.11 -m pip install pybind11==2.11.1 (I suggest to use this version, it might not work if you have numpy 2.0, in such case I suggest to use at least 2.12.x). Then make sure that the pybinnd11 lib found by cmake is the one installed for your python version : it should be installed in the dist-package folder of your python version in your personal folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants