I want to convert my .ui file to py but pyuic5 is not recognized
And when i go to my python directory this error message appears
how to fix this error?
A more generic option is:
python -m PyQt5.uic.pyuic filename.ui -o filename.py -x
I tried to convert my python gui application (.py ) to an executable file(.exe) using the pyinstaller module. I ran the following command in the terminal -
pyinstaller.exe --onefile -w sourcecode.py
The process was completed successfully and I got the .exe file(sourcecode.exe) along with the extra folders like pycache and sourcecode. But when I tried to run the .exe file/application by double clicking on it the app didn't start up and gave an error. Please help.
Try adding this --hidden-import to pyinstaller.exe --onefile -w sourcecode.py in case of hidden modules.
You can also try adding --debug to see what the error actually is.
I installed the designer from sourcefourge.net and installed the packages using pip , i also have the pyuic5.exe file in my scripts file , iam really confused
How can i solve this issue?
I got the same problem. In my case, for some reason, .ui file was crashed. So, I saved .ui file again in QT Design and run again the command into the files directory:
pyuic -x file.ui -o file.py
This solved my problem.
[]'s
I have a Tkinter GUI battleship game application I wrote that I am trying to convert to a .app file so I can run it easily on Mac OS X computers. After cding to the directory with both the main .py file, and all the subfiles (three other python files, a json file, and an icon file), I am executing the following command:
pyinstaller --onefile --windowed --icon favicon.icns --name Battleship battleship.py
This produces two files in the "dist" folder: Battleship and Battleship.app. The Battleship.app has the icon I specified in the command above.
When I run the non .app file (via double-clicking it), a terminal window opens and my Tkinter GUI opens and works (from the little testing I did) flawlessly. However, I would like only the GUI to open, without the terminal.
This is supposedly the purpose of also producing the .app file. However, when I run the .app file (via double-clicking it), it's icon merely bounces a few times in my application bar at the bottom of my screen, and then disappears. No actual window is opened.
How do I make it so when I double-click the .app file, my application's GUI actually opens (without a terminal window)?
Thanks in advance.
Note: I am using Python 3.5.1
RoberR seems like you are missing some necessary packages while building app from pyInstaller, I would suggest your to use:
pyinstaller --onefile --icon favicon.icns --name Battleship battleship.py
it will display your terminal and you would be able to figure out what is happening, in case of missing package please use:
pyinstaller --onefile --hidden-imports=file_name --icon favicon.icns --name Battleship battleship.py
Hope this solves your problems.
It is definitely an issue with Tkinter that crash when using the doubleclick on the .app. The only workaround I found was to use "brew python3" instead of "anaconda python3".
Reposting myself from: https://stackoverflow.com/a/57818744/10143204
There is a few issues with the tcl version that comes with python, discussed here. I've written an script that automatically changes the init.tcl file to the correct version.
N.B. you shouldn't use the --onefile flag as the file directories aren't present, and the script won't work.
cd /path/of/your/app
git clone https://github.com/jacob-brown/TCLChanger.git
pyinstaller --windowed app.py
python TCLChanger/TCLChanger.py
You should now be able to open your app, from the terminal and via double clicking.
In my command shell (cmd) I try to convert an .ui file to a .py file via
pyuic4 C:\Test\gui.ui > C:\Test\gui.py
But it says:
The command C:\Python27\python is either typed wrong or could not been found
I am using the Anaconda distribution which is placed under AppData/Local/Continuum/Anaconda and there is a python.exe.
Changing the directory does not work.
How can I compile my .ui-file?
Use OSGeo4W shell instead of cmd, it can easily convert the .ui file to .py
Run the following command in OSGeo4W shell:
C:\path\to\my\ui\files\>pyuic4 -o ui_form.py form.ui
Hope this helps!