Pyinstaller import error, image not found

I am trying to make an app for mac. When I use pyinstaller to create an exe on a Windows computer, it works fine, but when I do it on a Mac, the file matches, but then when it runs, I get the following errors.

Traceback (most recent call last): File "<string>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module exec(bytecode, module.__dict__) File "/Library/Frameworks/Python.framework/Versions/2.7/bin/build/new_client/out00-PYZ.pyz/FileDialog", line 11, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller/loader/pyi_importers.py", line 270, in load_module exec(bytecode, module.__dict__) File "/Library/Frameworks/Python.framework/Versions/2.7/bin/build/new_client/out00-PYZ.pyz/Tkinter", line 39, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyInstaller/loader/pyi_importers.py", line 409, in load_module module = imp.load_module(fullname, fp, filename, self._c_ext_tuple) ImportError: dlopen(/var/folders/vb/vb9xryxdEz467ZADn0LL7U+++TI/-Tmp-/_MEIbvFCo2/_tkinter.so, 2): Library not loaded: @loader_path/Tcl Referenced from: /var/folders/vb/vb9xryxdEz467ZADn0LL7U+++TI/-Tmp-/_MEIbvFCo2/_tkinter.so Reason: image not found 

Something seems to be wrong with Tkinter and TCL. Here are the modules that are loaded by the program.

 import socket, thread, time, json, traceback, FileDialog from functools import partial from mtTkinter import * 
+5
source share
1 answer

I used openpyxl and I need jdcal in the datetime.py module. None of the hidden imports or any of these measures for using pyinstaller helped, running exe would still say that jdcal was not found. The workaround I used was to simply copy a few functions from jdcal directly into datetime.py into openpyxl code. Then ran pyinstaller -F program.py

and it worked! Not the best answer, but when you try to get the project out the door for the client, it works.

0
source

Source: https://habr.com/ru/post/1214854/


All Articles