-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Fatal Python error: _PySys_BeginInit: can't initialize sys module #79894
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
Comments
. Current thread 0x00002b4e5f9bf400 (most recent call first): |
Hello. Can you elaborate this part? |
Sorry for the confusion. The three dots were for many lines of successful compilation output from make. The rest is the final few lines where the compilation fails. |
Because it's late, I will say it shortly: if you don't elaborate how you get this error, I will simply close the issue. You have to describe what you are trying to do, your OS, etc. (It works for me!) |
Please attach the full build log too along with the command executed. |
Configuration Options: ../configure --prefix=$HOME --enable-shared --enable-optimizations --with-system-expat --with-system-ffi --with-ensurepip=yes Make throws the following warning: *** WARNING: renaming "_curses_panel" since importing it failed: No module named '_curses' Python build finished successfully! The following modules found by detect_modules() in setup.py, have been Failed to build these modules: Following modules built successfully but were removed because they could not be imported: Could not build the ssl module! There ther is a following error... 0:06:18 load avg: 0.55 [171/416] test_hashlib Current thread 0x00002ba4468c7bc0 (most recent call first): Remove profile generation binary since we are done with it.make clean This is an expensive target to build and it does not have propermakefile dependency information. So, we create a "stamp" fileto record its completion and avoid re-running it.touch profile-run-stamp And then finally : Modules/_localemodule.o Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o Modules/zipimport.o Modules/faulthandler.o Modules/_tracemalloc.o Modules/hashtable.o Modules/symtablemodule.o Modules/xxsubtype.o Python/frozen.o Current thread 0x00002adc936069c0 (most recent call first): |
What is your OS (name and version)? What is your compiler (name and version)?
I have no idea why you get this error. You should try to run this function in a debugger like gdb and run the code step by step to see what happens. """ 0:06:18 load avg: 0.55 [171/416] test_hashlib Current thread 0x00002ba4468c7bc0 (most recent call first): That's maybe unrelated, but _test_pbkdf2_hmac() is not supposed to crash. |
Compiler: OS: Home directory is of type nfs in case that is relevant. |
Hum. Are you aware that PGO with GCC is broken on such old and unsupported Ubuntu version? My old note about that: "PGO is broken on Ubuntu 14.04 LTS with GCC 4.8.4-2ubuntu1~14.04: Modules/socketmodule.c:7743:1: internal compiler error: in edge_badness, at ipa-inline.c:895" https://pyperformance.readthedocs.io/usage.html#compile See also https://bugs.python.org/issue31963 I suggest you to not use PGO compilation on old Ubuntu. Maybe upgrade to latest Ubuntu LTS? |
compiling without optimizations worked. |
"""
I have no idea why you get this error. You should try to run this function in a debugger like gdb and run the code step by step to see what happens. I pushed 3 changes to get working exceptions and working sys.stderr earlier during Python initialization. It should help to display the current exceptions when Py_FatalError() is called during early stage of the Python initialization. |
Same error while building package for Ubuntu 14.04.
Previous python version compiled fine. Wait. It's maybe cos PGO enabled somehow. |
You're using old Python on old Ubuntu. Maybe use Ubuntu packages like deadsnakes instead of building Python yourself. Yes, enable-optimizations enables PGO. This issue is closed and Python 3.8 is no longer supported. Give a try to Python 3.11. |
Yeah, error gone if enable-optimizations removed from configure args. |
The problem persists for me for either 3.11 or 3.12 Glad to provide more details about the build environment if it helps to solve this problem. |
If you can reproduce the issue on a recent Python version, please open a new issue with complete instructions on how to reproduce it, the output and expected output. This issue is old and closed. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: