Python Forum
[PyQt] Get a executable file (.exe) from a .py file add a promoted class in a QWidget
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] Get a executable file (.exe) from a .py file add a promoted class in a QWidget
#1
Video 
Hi!! guys,
I am trying to get a .exe file ready to be executed from a click of a button on a screen (QMainWindow). In fact, in the past I have done it without any issue.
In this case I am adding a chart plotter as a figure from library : matplotlib set a promoted class using a QWidget.

I have 3 files attached to run this chart plotter as a file .exe shown below:

    
def UI_GetChart(self): 
                #win32api.ShellExecute(0, "open", "C:\Python3_11\Lib\APT_ControlPanel\SC\SC002_GetChart_plotter.exe", None, ".", 0)
                #subprocess.run(["C:\Python3_11\Lib\APT_ControlPanel\SC\dist\SC002_GetChart_plotter.exe"])          
                os.system("C:\Python3_11\Lib\APT_ControlPanel\SC\SC002_GetChart_plotter.exe")
                self.key_getChart.setCheckable(False)
                self.key_getChart.setCheckable(True)
                pass    
Reply of the Traceback:

Error:
File "SC\SC002_GetChart_plotter.py", line 68, in <module> # window = GetChart_plotter() ^^^^^^^^^^^^^^^^^^ File "SC\SC002_GetChart_plotter.py", line 20, in __init__ loadUi("C:\\Python3_11\\Lib\\APT_ControlPanel\\Screens\\004_GetChart_plotter.ui",self) File "PyQt5\uic\__init__.py", line 241, in loadUi File "PyQt5\uic\Loader\loader.py", line 66, in loadUi File "PyQt5\uic\uiparser.py", line 1037, in parse File "PyQt5\uic\uiparser.py", line 828, in createUserInterface File "PyQt5\uic\uiparser.py", line 806, in traverseWidgetTree File "PyQt5\uic\uiparser.py", line 273, in createWidget File "PyQt5\uic\uiparser.py", line 806, in traverseWidgetTree File "PyQt5\uic\uiparser.py", line 264, in createWidget File "PyQt5\uic\uiparser.py", line 228, in setupObject File "PyQt5\uic\objcreator.py", line 100, in createQObject File "PyQt5\uic\objcreator.py", line 125, in findQObjectType File "PyQt5\uic\Loader\qobjectcreator.py", line 113, in search ModuleNotFoundError: No module named 'mplwidget' [2472] Failed to execute script 'SC002_GetChart_plotter' due to unhandled exception! PS C:\Python3_11\Lib\APT_ControlPanel>
Any recommendation for doing it correctly Shocked

Attached Files

.py   000_Main.py (Size: 6.61 KB / Downloads: 57)
.py   mplwidget.py (Size: 698 bytes / Downloads: 79)
.py   SC002_GetChart_plotter.py (Size: 3.48 KB / Downloads: 72)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] Seeking guidance on PyQt Instantiation and correct way to use an instance of QWidget BrewBarred 3 540 Jan-23-2024, 07:21 AM
Last Post: deanhystad
  Upload file data on Qwidget maiya 4 1,436 Jul-08-2022, 08:34 AM
Last Post: Axel_Erfurt
  Import a file and show file name on qcombobox GMCobraz 1 1,987 Jul-02-2020, 01:38 PM
Last Post: GMCobraz
  [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
  [Tkinter] Issue with calling a Class/Method in GUI File Fre3k 3 3,035 Mar-08-2020, 12:35 PM
Last Post: Fre3k
  [Tkinter] How to get the name of a file only from a file path ? DT2000 4 10,430 Jul-25-2019, 08:27 PM
Last Post: DT2000
  Promoted QGroupBoxes take data one from the other panoss 1 3,002 Jan-07-2017, 03:31 PM
Last Post: panoss

Forum Jump:

User Panel Messages

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