-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
ImportError: _ssl.so: undefined symbol: _PyModule_Add #108525
Comments
I also observed the issue on my system. |
Also able to reproduce between 3.11 branch and 3.11.4, looks like #106863 broke the ABI |
@serhiy-storchaka as the commit author |
I don't think this warranty extends to the private API.
If you only use the public C API in your extension, you can expect forward- and backwards-compatibinility. |
I see the same error locally in poetry after my Ubuntu upgraded 3.11.? -> 3.11.5. Any advice how this can be mitigated/fixed? It doesn't look like I can downgrade local python back to 3.11.4 - deadsnakes ppa don't list 3.11.4 anymore |
@Templarrr I had the same issue and fixed it by updating poetry to the latest version. |
cc. RM @pablogsal |
@LostInDarkMath thank you! Seems to be the solution |
The reproducer looks contrived. In what situation would pieces of CPython get mixed up like this? Is Ubuntu's |
A faulty install or packaging script could easily cause this (but wouldn't be noticed in most cases, since they are usually ABI compatible) because the file paths are named identically (I.e., specific to 3.11, not 3.11.5). |
In this case it looks like a problem with poetry packaging (or its pythonpath?) |
The original issue was also related to Python + Poetry, by the way. |
This. ☝🏼 💯 |
My |
I encountered this issue in a python3.11-slim Dockerfile even after updating poetry. In my case, the issue was that the Dockerfile in question was installing the python3-dev apt package, which was providing 3.11.2 headers. I was able to remove this dependency without any repercussions. Was devilishly hard to track down so thought I'd share in case it helps someone else. |
See the following links for details: * python/cpython#108525 * https://tribe29.slack.com/archives/C02EQJ2LH9N/p1699281739711269?thread_ts=1698734755.744989&cid=C02EQJ2LH9N Change-Id: I81511fae3421d3be5a21331d9c4576a8e04194e6
Yes, the old poetry 1.6.1 is not working well with python 3.11 |
Usually, a Python binary loads its "own" Python stdlib. I don't think that we want to support using a newer/older Python with newer/older stdlib. You should use the exact same version for the Python binary and its stdlib. What can be done is to enhance error reporting. For example, but storing the version in stdlib C extensions and raise an error if there is version mismatch. Today, you get an ImportError because of a missing symbol. But tomorrow, you might get a crash because of subtle different behavior :-( |
I close the issue. I don't think that we want to support this use case. |
Bug report
Environment
Description
Importing the
ssl
shared library from a Python 3.11.5 build from a Python 3.11.4 binary produces anImportError
due to an undefined symbol. Isn't CPython's ABI supposed to be fully compatible between patch releases?Example
Error
Observations
It looks like fced79f is the breaking commit, as per
git bisect
results.Linked PRs
The text was updated successfully, but these errors were encountered: