I'm trying to distribute an executable file of a Python program I've created. For this purpose I'm using PyInstaller .
I use Windows 7 Professional with Python 3.7 The program runs successfully when inside PyCharm and produces the expected results.
As described in the PyInstaller manuals I've created the dist folder with:
pyinstaller main.py
The log output specifies that the process finished successfully.
When trying to run the main.exe from the distribution folder, the below error is produced:
Traceback (most recent call last):
File "site-packages\PyInstaller\loader\rthooks\pyi_rth_certifi.py", line 11, i
n <module>
File "c:\users\tim\anaconda3\envs\timtf2_37\lib\site-packages\PyInstaller\load
er\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "ssl.py", line 98, in <module>
ImportError: DLL load failed: The specified procedure could not be found.
[6236] Failed to execute script pyi_rth_certifi
So after a couple of hours, I managed to solve the problem. I did several things and still unsure what was the actuall fix, but this is the step-by-step flow I've done:
pip and conda.pyinstaller.pyinstaller from within it on the main.py script of the program with --hidden-import pyodbc argument.That's it, now the distibuted program works on all Windows computers in the office.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With