Python Forum
Thread Rating:
  • 3 Vote(s) - 2.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error no 2: no such file
#1
I 've made an exe with Pyinstaller.
But when I try to run it, I get an error: error no 2: no such file or directory: 'betws.ui'
This is the name of my form ( 'betws.ui'), so I should also include it in my .spec file?
I tried this, after 'binaries=[],' I added:
datas= [('betws.ui','gui')],
But I get the same error when I try to run it.
So, how can I include my form?
Reply
#2
Where is betws.ui located in your program structure?

note: I dont use pyinstaller so i am not familiar with their specs
Recommended Tutorials:
Reply
#3
It's in the same folder with the .py file.
The .py file loads the ui ('betws.ui') with this code:
class MyApp(QtGui.QMainWindow, QtGui.QWidget):
   def __init__(self):
       QtGui.QMainWindow.__init__(self)
      self.ui = uic.loadUi('betws.ui', self)
Reply
#4
Use pyuic5 to make a Python file that dos not relay on betws.ui.
pyuic5 -x betws.ui -o my_gui.py
Now run Pyinstaller on .py file.

There are some talk here,how to do it with .ui file in Pyinstaller.
Reply
#5
(May-16-2017, 02:39 PM)snippsat Wrote: There are some talk here,how to do it with .ui file in Pyinstaller.

Thanks, I solved this way.
Reply


Forum Jump:

User Panel Messages

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