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
2.x,3.x iOS static build: Fatal Python error: exceptions bootstrapping error. #59071
Comments
I trying to make minimal part of Python to work as part (static library) of my iOS application for internal scripting. I used configure under Mac OS X(10.7) and it was successful. Then I got compilable and linkable XCode project very fast.
The problem is, when I trying to use Python by
Py_NoSiteFlag=1;
Py_Initialize();
it fails with error "Fatal Python error: exceptions bootstrapping error." inside _PyExc_Init().
I tried to debug it, but unfortunately I cant understand why it fails. May be bacause I noob in Python source, but anyway, I need to port it. Tried 2.7.3, or latest 3.x, it was the same result as above. Any solution or hint will be very helpful. Best Regards |
Call stack: |
I tried look as deep as I can. The result from 3.2.3 port: it fails in Python/getargs.c:convertsimple():line 709, error "signed integer is less than minimum". It parses some parameters, and we have an error on last, 5th parameter. I really have no idea what happens here and why, knowing that same code works just fine under Windows. |
Most of the time, embedding python in this way requires precise control over PYTHONPATH and PYTHONHOME. Did you try to modify them?
Something like this worked for me:
putenv("PYTHONPATH=/path/to/python-3.2.3/Lib");
Py_SetPythonHome(L"/path/to/python-3.2.3");
I don't know whether both are needed. |
thank You for answer. my problem was finally solved by using build script from https://github.com/cobbal/python-for-iphone and patch from http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html |
The build script you mentioned seems to be for python 2.6, did you have to change anything beyond the version numbers to get it to build python 3.2 as well? |
actually I changed all, that was needed to build Python static library for iOS device(BTW it doesn't work for simulator, I got configure errors, I can't(or have no time if u want) to resolve), but not much changes. |
I embedded 2.7.2 static in iOS test app, and, at least "print "something"" is worked. |
fixed it for build BIG FAT binary. attached. |
Thanks for posting a working script. I was mostly interested in this because I'll likely need this functionality myself in the near future ;-) |
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: