DLL load failure with Python3 (32bit)+PyInstaller+UPX (32bit) under Windows 10 (64bit)

446 views Asked by At

So I'm generating exe with PyInstaller, using UPX as to make the size of the executable file smaller. However, the executable file generated with UPX shows errors like this:

PS [path]\dist> .\api
Traceback (most recent call last):
  File "api.py", line 4, in <module>
  File "e:\python\python375-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\pandas\__init__.py", line 55, in <module>
  File "e:\python\python375-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\pandas\core\api.py", line 24, in <module>
  File "e:\python\python375-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\pandas\core\groupby\__init__.py", line 1, in <module>
  File "e:\python\python375-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\pandas\core\groupby\generic.py", line 44, in <module>
  File "e:\python\python375-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\pandas\core\frame.py", line 115, in <module>
  File "e:\python\python375-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\pandas\core\series.py", line 4892, in <module>
  File "site-packages\pandas\core\generic.py", line 10747, in _add_series_or_dataframe_operations
  File "e:\python\python375-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\pandas\core\window.py", line 13, in <module>
ImportError: DLL load failed: 参数错误。[Note: "Incorrect arguments" in Chinese]
[133820] Failed to execute script api

However, if I use --noupx, the generated exe functions completely well. I believe that UPX corrupts some DLL files required by libraries like pandas, but I'd still like to compress as many DLL files as possible. How should I find out which DLL files are corrupted so that I can include them in --upx-exclude list?

0

There are 0 answers