0
votes

I successfully created .exe files using Pyinstaller. I was on a Windows 7 machine using Anaconda3, PyQt5, OpenCV3, and Python 3.6. Anaconda3 was in the Windows Environment Path. Because there is no release for Pyinstaller for Python 3.6, I created a Python 3.5.3 environment (with OpenCV) within Anaconda3. I wrote the software in Python 3.6, then activated Python3.5.3 to run Pyinstaller. The executable worked flawlessly. The dist folder was abot 370MB.

Then I upgraded the machine to Windows 10 using a clean installation. I installed Anaconda3 (Anaconda3 was added to the Windows Environment Path) and OpenCV (PyQt5 was already available within Anaconda3), created the Python3.5.3 environment, installed PyInstaller iand OpenCV nto the Python 3.5.3 environment. Using Spyder and Python 3.6, the script runs perfectly. When activating Python 3.5.3 and running python myscript.py from the command line, the script ran flawlessly. However, Pyinstaller only installs about 220MB and the resultant executable does not execute.

I don’t have the old dist folder from the successful Windows 7 build to see what files were added to the dist folder that were not added when in Windows 10.

Does anyone know how I can determine the additional files needed for the Pyinstaller buid?

1

1 Answers

0
votes

I switched to cx_Freeze. It also didn't work at first, but then I added optional packages PyQt5, cv2, and numpy. cx_Freeze crashed and gave me an error about PyQt5, so I took PyQt5 out of the optional packages and ran python setup.py build again and it worked. So then I removed cv2 and it still worked. Then I removed numpy and it failed. So I added numpy back in. Here is setup.py

from cx_Freeze import setup, Executable

exe=Executable(
     script="VSWv08.py", base = "Win32GUI")
includefiles=["VSWManual.txt", "VSWLicense.txt"]
includes=[]
excludes=[]
packages=["numpy"]
setup(

     version = "1.0",
     description = "MyApplication",
     author = "Me",
     name = "My Application",
     options = {'build_exe': 
{'excludes':excludes,'packages':packages,'include_files':includefiles}},
     executables = [exe]
     )