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
ModuleNotFoundError: No module named '_multiprocessing' -- when _multiprocessing
is built-in
#8111
Comments
Can you open I suspect that the CIPD python doesn't actually have a shared library (and thus cannot work with PyInstaller), and instead we end up collecting shared library from the Debian python, and hence those supposed built-ins end up missing. |
Bingo. ...
('xml.sax.xmlreader',
'.../environment/cipd/packages/python311/lib/python3.11/xml/sax/xmlreader.py',
'PYMODULE'),
('http.client',
'.../environment/cipd/packages/python311/lib/python3.11/http/client.py',
'PYMODULE')]
[('libpython3.11.so.1.0',
'/lib/x86_64-linux-gnu/libpython3.11.so.1.0',
'BINARY'),
('libz.so.1', '/lib/x86_64-linux-gnu/libz.so.1', 'BINARY'),
('libexpat.so.1', '/lib/x86_64-linux-gnu/libexpat.so.1', 'BINARY')],
Interestingly, my Debian
Does this mean that PyInstaller has to search/hope that there is a |
I think Debian does some weird thing where it creates the
Not sure if the matching versions had a hand in this but yes to the rest of it. |
Hmm, well I'm not sure how an issue like this can be fixed unless PyInstaller makes a substantial change where it re-executes Python (using its own front-end executable?!) using the "found" |
Fixing this issue would just mean raising the libpython.so not found error. PyInstaller's bootloaders need that library to run. |
Yes. We typically infer the location of In this case, CIPD python did not have shared lib at all - normally, this would raise the "libpython.so not found" error. But because system-provided python was exact match version-wise, its shared lib was picked up instead. I don't think we can come up with a reasonable heuristic to counter that, nor I think it is really worth it, since CIPD python is not compatible with PyInstaller anyway due to lack of the shared lib. |
The CIPD version is built with |
I suppose we could try detecting known problematic python builds based on sys.version, and raise an error immediately; i.e., something along the lines of "This version of Python is not supported by PyInstaller." instead of the more generic "libpython.so not found" error. |
Description of the issue
It appears that PyInstaller (perhaps
rthooks/pyi_rth_multiprocessing.py
) fails when_multiprocessing
is built-in to Python, rather than a module.Context information (for bug reports)
pyinstaller --version
:6.2.0
Python 3.11.3+chromium.29
(from CIPD packageinfra/3pp/tools/cpython3/linux-amd64/3ywmFUOaOaFOgNvtlG9w1GSzYXssvcYo2UvqnTfZsNsC
)A minimal example program which shows the error
testapp.py
When run directly using Python from CIPD (in a virtualenv):
👉 Note that
_multiprocessing
is(built-in)
. 👈When run directly using Python from Debian:
👉 Note that
_multiprocessing
is a.so
module. 👈Stacktrace / full error message
Using Python from CIPD:
Using Python from Debian:
The text was updated successfully, but these errors were encountered: