Python Forum

Full Version: error no 2: no such file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
Where is betws.ui located in your program structure?

note: I dont use pyinstaller so i am not familiar with their specs
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)
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.
(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.