pyinstaller / pyinstaller/pyinstaller

Wine + Python 3.5 or 3.6 + Numpy

Open
#2,797 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13.1k
Forks
2k
Avg merge
1d 3h
Merged PRs (30d)
11

Description

Versions

  • Pyinstaller 3.2.1 or master
  • Python 3.5.x and above
  • Wine: wine-devel

Recrate

  • Any linux, docker, VM, etc.
  • Install wine-devel
  • Install pyinstaller
  • pip install numpy

Example python:

import numpy as np
a = np.array([1, 2, 3])
print(a)

Result

It builds fine. But doesn't work when you execute it.

Executable output after building with pyinstaller --debug test.py:

PyInstaller Bootloader 3.x
LOADER: executable is C:\Users\winderresearch\test\test\test.exe
LOADER: homepath is C:\Users\winderresearch\test\test
LOADER: _MEIPASS2 is NULL
LOADER: archivename is C:\Users\winderresearch\test\test\test.exe
LOADER: No need to extract files to run; setting extractionpath to homepath
LOADER: SetDllDirectory(C:\Users\winderresearch\test\test)
LOADER: Already in the child - running user's code.
LOADER: Python library: C:\Users\winderresearch\test\test\python35.dll
LOADER: Loaded functions from Python library.
LOADER: Manipulating environment (sys.path, sys.prefix)
LOADER: Pre-init sys.path is C:\Users\winderresearch\test\test\base_library.zip;C:\Users\winderresearch\test\test
LOADER: sys.prefix is C:\Users\winderresearch\test\test
LOADER: Setting runtime options
LOADER: Initializing python
LOADER: Overriding Python's sys.path
LOADER: Post-init sys.path is C:\Users\winderresearch\test\test\base_library.zip;C:\Users\winderresearch\test\test
LOADER: Setting sys.argv
LOADER: setting sys._MEIPASS
LOADER: importing modules from CArchive
LOADER: extracted struct
LOADER: callfunction returned...
LOADER: extracted pyimod01_os_path
LOADER: callfunction returned...
LOADER: extracted pyimod02_archive
LOADER: callfunction returned...
LOADER: extracted pyimod03_importers
LOADER: callfunction returned...
LOADER: Installing PYZ archive with Python modules.
LOADER: PYZ archive: out00-PYZ.pyz
LOADER: Running pyiboot01_bootstrap.py
LOADER: Running pyi_rth_win32comgenpy.py
Traceback (most recent call last):
  File "site-packages\PyInstaller\loader\rthooks\pyi_rth_win32comgenpy.py", line 47, in <module>
  File "c:\Python3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
  File "site-packages\win32com\__init__.py", line 5, in <module>
  File "c:\Python3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 573, in load_module
ImportError: DLL load failed: %1 is not a valid Win32 application.
Failed to execute script pyi_rth_win32comgenpy

Workaround

The only way I've been able to fix this is by downgrading python to 3.4.x, then everything works fine.

What I've tried

Different versions of 3.5.x. Downloading the mkl versions of the windows binaries. Including lots of other libraries that didn't seem to make a difference. Different wine distributions. Different OS's. Different versions of pyinstaller.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported Python 3.5 or 3.6 build under Wine with the provided test.py and numpy example. Trace the failure from pyi_rth_win32comgenpy.py through pyimod03_importers.py, then verify that the generated executable runs successfully without downgrading Python to 3.4.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.