-
Notifications
You must be signed in to change notification settings - Fork 107
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
Using PyInstaller with nogil python #134
Comments
Solving this properly would require that either PyInstaller can handle the bytecodes in the |
FWIW, the free-threaded (i.e, "nogil) build of 3.13 uses the same bytecodes as the default build, and so won't have this problem. (Assuming that PyInstaller can support CPython 3.13) |
So if I understand correctly, the latest version of cpython 3.13 supports to natively turn off gil? I found this: pyinstaller have some support: "PyInstaller will also not work with beta releases of Python 3.13.". Can you please clarify if there are any significant differences between nogil in this fork and python 3.13 build with --disable-gil ? (except, of course, for differences between versions of Python) |
We are working towards that, but it is not ready yet.
They have the same goal (no GIL) but otherwise the implementations are pretty different. A lot of Python internals changed between Python 3.9 and Python 3.13. For example, the Python bytecodes, which look to be the source of the PyInstaller incompatibility are different in Python 3.9, Python 3.13, and this nogil fork. However, they should be the same between the |
Hello,
I have nogil-python compiled under Windows with an application built in Cython - and everything works fine. But there are problems when I tried to wrap the application using PyInstaller, the following error occurred:
it looks like a problem with nogil-python, because the package is completed fine under pyinstaller with standard cpython. But i tried to make these dumb fixes:
In nogil-python/Lib/site-packages/PyInstaller/depend/bytecode.py added this under imports:
dis.opmap['EXTENDED_ARG'] = 144
Than added bound check in this function:
Than updated this:
And in function:
def function_calls(code: CodeType) -> list:
added check:
and in file nogil-python/Lib/dis.py added bound check in this function:
after these fixes, PyInstaller starts and successfully packages the application into a working binary. However, it is worth mentioning that almost the entire application is written in Cython and everything is compiled in the Cython module. I'm not sure if these fixes will work in a pure Python application - apparently it omits some calls or arguments.
Do you have an idea how to solve this problem properly?
The text was updated successfully, but these errors were encountered: