0

I am trying to translate a file from a ui file in python I am writing a team

pyside-uic "C:\test.ui" -x -o "C:\test.py"

in team squad, but it tells me that there is no such team. Changed to "pyside2-uic" but still did not help Tell me how to fix it? Python 3.7.6 and Pyside2. I tried to use

import sys, pprint
from pysideuic import compileUi
pyfile = open("[path to output python file]\output.py", 'w')
compileUi("[path to input ui file]\input.ui", pyfile, False, 4,
False)
pyfile.close()

but module pysideuic not found. What else can i do? I haven’t installed pyside2-tools or pyside-tools for some reason, so if I need to download them somewhere, tell me how. I already tried downloading through pip but it didn’t work.

or latym
  • 105
  • 1
  • 6

2 Answers2

3

I'm not sure that I fully understood your question as "team squad" isn't clear for me. But I'm sure that you need to install pyside2-tools as UI compiler is a part of this package. And I want to mention that pyside-uic was removed starting from some python version (I think 3.8, but not sure). With actual version you should use following command (linux example, but for windows it is very similar):

uic -g python -o <ouput_python_file> <input_ui_file>
StarterKit
  • 488
  • 4
  • 15
  • but how do I install pyside2-tools. I already used the command `pip install pyside2-tools` `uic -g python -o pyside2-tools` but it did not work – or latym Jan 23 '20 at 22:28
  • By "did not work" - what exactly do you mean? I understand you have Windows. So, do you have uic.exe or pyside-uic.exe on your disk? (I assume it should be located somewhere like C:\Users\\AppData\Python\Scripts) – StarterKit Jan 25 '20 at 07:45
  • The only thing I have is uic.exe and it is located "C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\PySide2" I have no pyside-uic.exe – or latym Jan 26 '20 at 12:42
  • Ok, clear. Then what happens when you try `uic.exe -g python -o C:\test.py C:\test.ui`? – StarterKit Jan 27 '20 at 15:47
  • "uic.exe" is not internal or external command executing program or batch file. – or latym Jan 28 '20 at 07:08
  • This simply means your OS (windows) doesn't know where uic.exe is located (it's location absend in your PATH env variable). You should either add uic.exe location to PATH (and reboot) or use a full path in command, i.e. `C:\\uic.exe -g python -o C:\test.py C:\test.ui` – StarterKit Jan 28 '20 at 08:19
0
<resources>
   <include location="ui.files.qrc"/>
</resources>

actually, ui is folder, like this: D:\qt5_design\project\ui\files.qrc

pyrcc5 files.qrc -o ui.files.py
JTL
  • 41
  • 3