pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.39k stars 2.07k forks source link

rename example.cpython-311-x86_64-linux-gnu.so to example.so #4738

Closed swuecho closed 1 year ago

swuecho commented 1 year ago

image

swuecho commented 1 year ago

image

swuecho commented 1 year ago

It take me a while to figure out I need example.so instead of the example.cpython-311-x86_64-linux-gnu.so , hence the pr.

henryiii commented 1 year ago

Nope, that's not the correct solution. You are building with Python 3.11, then running with IPython that's been installed with Python 3.10. If you are lucky, it might work, but it will more likely segfault. You can't use a Python 3.x extension with Python 3.y when $x\ne y$.

You need to either build with 3.10 or load it in 3.11. That's one of the reasons for this extension - to protect against that. (Or you can install a kernel for 3.11 and use that with the existing IPython)

henryiii commented 1 year ago

(PS: thank you for the clear description with example of what was happening!)

swuecho commented 1 year ago

image

verified works great with correct python version. my bad! Sorry to bother you.

henryiii commented 1 year ago

No problem, glad it works now! :)