Problems using Pynsist to make exe of python gui application (Repeating "ModuleNotFoundError" for unused modules)

365 Views Asked by At

As I run the installer.cfg I keep getting "ModuleNotFoundError"s for modules I never use in my code. For example, the first time I ran it I got "ModuleNotFoundError: No module named 'sip'" so I included sip in the list of packages in the installer.cfg file and the problem was fixed. But then a new "ModuleNotFoundError" popped up. Thus I kept adding more and more modules to the list of packages in the installer.cfg file.

(I did this because someone on the internet explained that he had solved his problems with Pynsist by doing this: https://github.com/takluyver/pynsist/issues/123#issuecomment-322269903 - I may have misunderstood this)

Is this what I'm supposed to be doing? It doesn't seem to make sense since it asks me to import modules I never use. I don't know when the list of random modules I need will end. Plus it's bothersome because now I've gotten an "ImportError: DLL load failed: The specified module could not be found." (referring to tkinter) so now I've got to install a module I make no use of.

installer.cfg:

[Application]
name=GUI
version=1.0
# How to launch the app - this calls the 'main' function from the 'myapp' 
package:
entry_point=gui:main

[Python]
version=3.6.5

[Include]
# Packages from PyPI that your application requires, one per line
packages = requests
  matplotlib
  seaborn
  numpy
  PyQt5
  sip
  six
  pyparsing
  cycler
  dateutil
  kiwisolver
  tkinter
  _tkinter
# These must have wheels on PyPI:
pypi_wheels = requests==2.18.4
     beautifulsoup4==4.6.0
     html5lib==0.999999999

# Other files and folders that should be installed

modules being used:

import sys

from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *

import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
import seaborn as sns

import numpy as np
from numpy.linalg import inv
0

There are 0 best solutions below