Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. pyside2-uic: command not found
Forum Updated to NodeBB v4.3 + New Features

pyside2-uic: command not found

Scheduled Pinned Locked Moved Unsolved Qt for Python
8 Posts 3 Posters 2.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Scooter
    wrote on last edited by
    #1

    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.

    SGaistS 1 Reply Last reply
    0
    • S Scooter

      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.

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What exactly did you install ?
      On which distribution ?
      For example, on Debian, it's in the pyside2-tools package.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • G Offline
        G Offline
        Gregory Gurmatroyid
        wrote on last edited by Gregory Gurmatroyid
        #3

        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-forge

        I 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?

        G 1 Reply Last reply
        0
        • G Offline
          G Offline
          Gregory Gurmatroyid
          wrote on last edited by Gregory Gurmatroyid
          #4

          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

          1 Reply Last reply
          0
          • G Gregory Gurmatroyid

            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-forge

            I 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?

            G Offline
            G Offline
            Gregory Gurmatroyid
            wrote on last edited by
            #5

            @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
            
            1 Reply Last reply
            0
            • G Offline
              G Offline
              Gregory Gurmatroyid
              wrote on last edited by
              #6

              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.

              SGaistS 1 Reply Last reply
              0
              • G Gregory Gurmatroyid

                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.

                SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @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())
                

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                1
                • G Offline
                  G Offline
                  Gregory Gurmatroyid
                  wrote on last edited by
                  #8

                  Excellent, thank you. Whoever else finds this from Google will be covered.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved