pyside2-uic: command not found
-
I get the following error .... bash: pyside2-uic: command not found. How can i get this to run? When I loaded Pyside2 originally using sudo install ... this package was noted as not being found.
Hi and welcome to devnet,
What exactly did you install ?
On which distribution ?
For example, on Debian, it's in the pyside2-tools package. -
Hello,
I have this same issue (MacOS here). Installed Qt Creator, and gave it a conda env with (filtered list, can show the whole thing):
pyside6 6.4.2 py310h26ac0f8_1 conda-forge
pyside6-uic-extended 0.0.1 pypi_0 pypi
pyside6-utils 1.2.2 pypi_0 pypi
qt6-main 6.4.2 hba381f7_4 conda-forgeI can't find uic nor pyside6-uic anywhere.
Brew seems to have version 6 under the unnumbered alias "pyside", which maybe contains pyside-uic.. but that's unclear and Id rather ask before risking some kind of awful conflict to untangle.Where is pyside-uic, on its own if possible?
-
This fresh env with only pyqt6 and pyside6 doesn't work either :
pyqt6 6.7.0 pypi_0 pypi
pyqt6-qt6 6.7.2 pypi_0 pypi
pyqt6-sip 13.8.0 pypi_0 pypi
pyside6 6.7.2 pypi_0 pypi
pyside6-addons 6.7.2 pypi_0 pypi
pyside6-essentials 6.7.2 pypi_0 pypi -
Hello,
I have this same issue (MacOS here). Installed Qt Creator, and gave it a conda env with (filtered list, can show the whole thing):
pyside6 6.4.2 py310h26ac0f8_1 conda-forge
pyside6-uic-extended 0.0.1 pypi_0 pypi
pyside6-utils 1.2.2 pypi_0 pypi
qt6-main 6.4.2 hba381f7_4 conda-forgeI can't find uic nor pyside6-uic anywhere.
Brew seems to have version 6 under the unnumbered alias "pyside", which maybe contains pyside-uic.. but that's unclear and Id rather ask before risking some kind of awful conflict to untangle.Where is pyside-uic, on its own if possible?
@Gregory-Gurmatroyid said in pyside2-uic: command not found:
Brew seems to have version 6 under the unnumbered alias "pyside", which maybe contains pyside-uic.. but that's unclear and Id rather ask before risking some kind of awful conflict to untangle.
This does it. But then calling pyside6-uic immediately, no matter with/without arguments or --help, gives exception:
Traceback (most recent call last): File "/Users/anonymous/miniconda3/bin/pyside6-uic", line 8, in <module> sys.exit(uic()) File "/Users/anonymous/miniconda3/lib/python3.9/site-packages/PySide6/scripts/pyside_tool.py", line 90, in uic qt_tool_wrapper("uic", ['-g', 'python'] + sys.argv[1:], True) File "/Users/anonymous/miniconda3/lib/python3.9/site-packages/PySide6/scripts/pyside_tool.py", line 52, in qt_tool_wrapper pyside_dir = Path(ref_mod.__file__).resolve().parent File "/Users/anonymous/miniconda3/lib/python3.9/pathlib.py", line 1082, in __new__ self = cls._from_parts(args, init=False) File "/Users/anonymous/miniconda3/lib/python3.9/pathlib.py", line 707, in _from_parts drv, root, parts = self._parse_args(args) File "/Users/anonymous/miniconda3/lib/python3.9/pathlib.py", line 691, in _parse_args a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType
-
So instead, cheating:
Go to your directory with the ui (etc) files, with the venv activated (e.g. conda), and :from PySide6.scripts.pyside_tool import qt_tool_wrapper qt_tool_wrapper("uic", ['-g', 'python'] + ["./form.ui", "-o", "./ui_form.py"], True)
There's no verbose anything, and exit() is called on success; so look at the directory to see results.
-
So instead, cheating:
Go to your directory with the ui (etc) files, with the venv activated (e.g. conda), and :from PySide6.scripts.pyside_tool import qt_tool_wrapper qt_tool_wrapper("uic", ['-g', 'python'] + ["./form.ui", "-o", "./ui_form.py"], True)
There's no verbose anything, and exit() is called on success; so look at the directory to see results.
@Gregory-Gurmatroyid just checked on my machine:
Installed with pip in a conda environment:PySide6==6.7.1 PySide6_Addons==6.7.1 PySide6_Essentials==6.7.1
and
PySide6==6.7.2 PySide6_Addons==6.7.2 PySide6_Essentials==6.7.2
both have pyside6-uic in the bin folder of the conda environment.
The content of the file is:
#!/Users/anonymous/miniconda3/envs/qt/bin/python # -*- coding: utf-8 -*- import re import sys from PySide6.scripts.pyside_tool import uic if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(uic())
-
Excellent, thank you. Whoever else finds this from Google will be covered.