How to transform a .ui to a .py on mac - python

I need to transform an .ui archive to a .py but I can't use the command pyuic4, it said command not found in the terminal.
I already try installing pyside, pyqt, use uic.py but nothing seems to work.

So, I finally solved it. I used pyuic5 -x Data.ui -o Data_ui.py in the terminal, but first I opened the folder where the executable pyuic5 was, paste Data.ui and then use the line pyuic5 -x Data.ui -o Data_ui .py. Remember to open the location of the executable in the terminal before using the command

Related

pyuic5 works on one machine but not another [duplicate]

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

pyinstaller working but .exe application not staring up

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.

pyuic5 command not found , I did everthing and still get this same error

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

Tkinter program converted to .app using PyInstaller closes immediately

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.

Tell the shell to use a certain python.exe

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!

Categories