Python Forum
Why I am getting ModuleNotFoundError when I make an Exe file for tkinter GUI?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why I am getting ModuleNotFoundError when I make an Exe file for tkinter GUI?
#1
I have a simple code to use the LHS design of the experiment, and it works fine.

from tkinter import *
from pyDOE import *

root = Tk()
root.geometry("400x400")

n_points = IntVar()
n_features = IntVar()

label1 = Label(root, text="Initial No. sample points:")
label1.grid(row=0, column=0)

entry1 = Entry(root, textvariable=n_points)
entry1.grid(row=0, column=1)

label2 = Label(root, text="No. parameters:")
label2.grid(row=1, column=0)

entry2 = Entry(root, textvariable=n_features)
entry2.grid(row=1, column=1)

label3 = Label(root)
label3.grid(row=3, column=0, columnspan=2)

def LHS():
    lhs_design = lhs(n_features.get(), samples=n_points.get(), criterion="corr")
    label3.config(text="your design is:" + str(lhs_design))

mybutton = Button(root, text="Calculate!", command=LHS)
mybutton.grid(row=2, column=0, columnspan=2)

root.mainloop()
I want to create an Exe file using pyinstaller. I follow these steps:

1. put mycode.py in a folder.
2. open cmd, and I change the directory to the folder
3. run pyinstaller --onefile -w mycode.py
4. Then in the created dist folder, there would be an Exe file

however, when I run the exe file, I get this error:

Error:
Traceback (most recent call last): File "mycode.py", line 2, in <module> ModuleNotFoundError: No module named 'pyDOE'
Am I making a mistake somewhere in the code that I have run in cmd? or do I need to add the pyDOE package somewhere in the exe file folder?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  make widgets disappear from tkinter jacksfrustration 12 1,191 Feb-06-2024, 03:58 PM
Last Post: deanhystad
  [Tkinter] It it possible to make a help file explorer with tkinter? Clunk_Head 0 1,998 Aug-07-2021, 06:02 PM
Last Post: Clunk_Head
  [Tkinter] tkinter.Menu – How to make text-variable? Sir 3 5,673 Mar-10-2021, 04:21 PM
Last Post: Sir
  Tkinter Python: How to make sure tkSimpleDialog takes in No value entered rcmanu95 3 2,363 Aug-05-2020, 05:32 AM
Last Post: Yoriz
  How to make button text bold in Tkinter? scratchmyhead 2 12,101 May-16-2020, 02:53 AM
Last Post: scratchmyhead
  [Tkinter] Tkinter - I need to read file excel from GUI app to script file johnjh 0 10,745 Apr-17-2020, 08:14 PM
Last Post: johnjh
  Make Label Text background (default color) transparent using tkinter in python barry76 1 23,867 Nov-28-2019, 10:19 AM
Last Post: Larz60+
  Tkinter - Make changes to graph and update it adriancovaci 0 6,617 Apr-08-2019, 09:02 AM
Last Post: adriancovaci
  [Tkinter] Multiple frames with tkinter - How to make them run on fullscreen mode eabs86 3 18,286 Sep-20-2018, 01:27 AM
Last Post: eabs86

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020