pyinstaller .exe cannot import a .pyd

28 views
Skip to first unread message

Demetrios Tsillas

unread,
Nov 5, 2019, 1:42:50 PM11/5/19
to PyInstaller
Hi Folks,

I've run into a little problem after several years of happy pyinstalling.

I'm using pyinstaller from Python 2.7.15 installed from python.org on Windows 10.

I've installed it via pip and have seen this problem with the latest version and the dev version.

The problem is that the app cannot import a .pyd library which is in the dist directory. This .pyd is built using swig from msys2. According to a dll dependencies checker the .pyd under the dist dir has everything it needs.

I am able to import this .pyd running python from cmd.exe.

I have run using debug=1 and it doesn't give any indication of a problem right until I see "Failed to execute script".

Running from a cmd.exe produces no console output but if I run from an msys2 console I see:

(master) $ ./InstrumentationBrowser.exe
Traceback (most recent call last):
  File "InstrumentationBrowser.py", line 8, in <module>
    import InstrumentationModel
  File "c:\users\viasat\appdata\local\temp\pip-install-zh9rc1\PyInstaller\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
  File "InstrumentationModel.py", line 13, in <module>
    from . import _InstrumentationModel
ImportError: cannot import name _InstrumentationModel

I've attached the output from the pyinstaller command and the spec file I am using.

I've also put a zip of the dist dir here: http://immortalsunited.com/files/dist.zip

Like I said I've been a happy user for a couple of years and just started seeing this problem. Unfortunately I can't say what the last working version was.

thanks!!!
-Jim.

output.txt
InstrumentationBrowser-Windows.spec

Hartmut Goebel

unread,
Nov 7, 2019, 5:48:07 AM11/7/19
to pyins...@googlegroups.com
Am 05.11.19 um 19:17 schrieb Demetrios Tsillas:
  File "InstrumentationModel.py", line 13, in <module>
    from . import _InstrumentationModel
ImportError: cannot import name _InstrumentationModel

Please have a look at <https://github.com/pyinstaller/pyinstaller/wiki/If-Things-Go-Wrong>

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: https://www.goe-con.de/blog/kamera-safari-durch-die-munchner-innenstadt
Kolumne: https://www.goe-con.de/hartmut-goebel/cissp-gefluester/2011-02-fleisige-datensammler-fur-lukratives-geschaeftsmodell-gesucht

0x7B752811BF773B65.asc

Demetrios Tsillas

unread,
Nov 8, 2019, 6:30:09 AM11/8/19
to PyInstaller
I spent some time with VM snapshots to test after each upgrade step and I found that this is not a pyinstaller issue after all.

The problem happens once I do an update of msys2.
Reply all
Reply to author
Forward
0 new messages