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. Environment variable PYSIDE_DESIGNER_PLUGINS is not set, bailing out
Forum Updated to NodeBB v4.3 + New Features

Environment variable PYSIDE_DESIGNER_PLUGINS is not set, bailing out

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 3 Posters 4.9k Views 1 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
    shepard127
    wrote on last edited by
    #1

    I created a small * .ui file in 'pyside6-designer' then run it through QUiLoader (Loading it directly).
    I ran the sample code from the site (https://doc-snapshots.qt.io/qtforpython-dev/tutorials/basictutorial/uifiles.html).

    After running the main.py file, I get messages to the console:

    qt.pysideplugin: Environment variable PYSIDE_DESIGNER_PLUGINS is not set, bailing out.
    qt.pysideplugin: No instance of QPyDesignerCustomWidgetCollection was found.
    

    And after that my code works fine, but I don't know how to disable these messages?

    I read this post:
    https://stackoverflow.com/questions/68528717/environment-variable-pyside-designer-plugins-is-not-set-bailing-out

    And this one:
    https://doc-snapshots.qt.io/qtforpython-dev/tutorials/basictutorial/uifiles.html#custom-widgets-in-qt-designer

    And this:
    https://www.qt.io/blog/qt-for-python-6.1

    I still can't understand. Please help me

    My code 'main.py' file:

    import sys
    from PySide6.QtUiTools import QUiLoader
    from PySide6.QtWidgets import QApplication
    from PySide6.QtCore import QFile, QIODevice
    
    if __name__ == "__main__":
        app = QApplication(sys.argv)
    
        ui_file_name = "qtable.ui"
        ui_file = QFile(ui_file_name)
        if not ui_file.open(QIODevice.ReadOnly):
            print(f"Cannot open {ui_file_name}: {ui_file.errorString()}")
            sys.exit(-1)
        loader = QUiLoader()
        window = loader.load(ui_file)
        ui_file.close()
        
        if not window:
            print(loader.errorString())
            sys.exit(-1)
        window.show()
    
        sys.exit(app.exec())
    

    My 'qtable.ui' file:

    <?xml version="1.0" encoding="UTF-8"?>
    <ui version="4.0">
     <class>MainWindow</class>
     <widget class="QMainWindow" name="MainWindow">
      <property name="geometry">
       <rect>
        <x>0</x>
        <y>0</y>
        <width>658</width>
        <height>476</height>
       </rect>
      </property>
      <property name="windowTitle">
       <string>MainWindow</string>
      </property>
      <widget class="QWidget" name="centralwidget">
       <widget class="QTableWidget" name="tableWidget">
        <property name="geometry">
         <rect>
          <x>30</x>
          <y>40</y>
          <width>611</width>
          <height>192</height>
         </rect>
        </property>
       </widget>
       <widget class="QPushButton" name="pushButton">
        <property name="geometry">
         <rect>
          <x>60</x>
          <y>260</y>
          <width>75</width>
          <height>24</height>
         </rect>
        </property>
        <property name="text">
         <string>PushButton</string>
        </property>
       </widget>
       <widget class="QPushButton" name="pushButton_2">
        <property name="geometry">
         <rect>
          <x>190</x>
          <y>260</y>
          <width>75</width>
          <height>24</height>
         </rect>
        </property>
        <property name="text">
         <string>PushButton</string>
        </property>
       </widget>
      </widget>
      <widget class="QMenuBar" name="menubar">
       <property name="geometry">
        <rect>
         <x>0</x>
         <y>0</y>
         <width>658</width>
         <height>22</height>
        </rect>
       </property>
      </widget>
      <widget class="QStatusBar" name="statusbar"/>
     </widget>
     <resources/>
     <connections/>
    </ui>
    

    I also looked at your example from this link: https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/widgetbinding

    I didn't find *.ui file here. Only some xml code in the 'registerwigglywidget.py' file. I don't understand. I need to create *.ui file, then copy the xml content to registerX.py every time (if changed)?

    A 1 Reply Last reply
    1
    • S shepard127

      I created a small * .ui file in 'pyside6-designer' then run it through QUiLoader (Loading it directly).
      I ran the sample code from the site (https://doc-snapshots.qt.io/qtforpython-dev/tutorials/basictutorial/uifiles.html).

      After running the main.py file, I get messages to the console:

      qt.pysideplugin: Environment variable PYSIDE_DESIGNER_PLUGINS is not set, bailing out.
      qt.pysideplugin: No instance of QPyDesignerCustomWidgetCollection was found.
      

      And after that my code works fine, but I don't know how to disable these messages?

      I read this post:
      https://stackoverflow.com/questions/68528717/environment-variable-pyside-designer-plugins-is-not-set-bailing-out

      And this one:
      https://doc-snapshots.qt.io/qtforpython-dev/tutorials/basictutorial/uifiles.html#custom-widgets-in-qt-designer

      And this:
      https://www.qt.io/blog/qt-for-python-6.1

      I still can't understand. Please help me

      My code 'main.py' file:

      import sys
      from PySide6.QtUiTools import QUiLoader
      from PySide6.QtWidgets import QApplication
      from PySide6.QtCore import QFile, QIODevice
      
      if __name__ == "__main__":
          app = QApplication(sys.argv)
      
          ui_file_name = "qtable.ui"
          ui_file = QFile(ui_file_name)
          if not ui_file.open(QIODevice.ReadOnly):
              print(f"Cannot open {ui_file_name}: {ui_file.errorString()}")
              sys.exit(-1)
          loader = QUiLoader()
          window = loader.load(ui_file)
          ui_file.close()
          
          if not window:
              print(loader.errorString())
              sys.exit(-1)
          window.show()
      
          sys.exit(app.exec())
      

      My 'qtable.ui' file:

      <?xml version="1.0" encoding="UTF-8"?>
      <ui version="4.0">
       <class>MainWindow</class>
       <widget class="QMainWindow" name="MainWindow">
        <property name="geometry">
         <rect>
          <x>0</x>
          <y>0</y>
          <width>658</width>
          <height>476</height>
         </rect>
        </property>
        <property name="windowTitle">
         <string>MainWindow</string>
        </property>
        <widget class="QWidget" name="centralwidget">
         <widget class="QTableWidget" name="tableWidget">
          <property name="geometry">
           <rect>
            <x>30</x>
            <y>40</y>
            <width>611</width>
            <height>192</height>
           </rect>
          </property>
         </widget>
         <widget class="QPushButton" name="pushButton">
          <property name="geometry">
           <rect>
            <x>60</x>
            <y>260</y>
            <width>75</width>
            <height>24</height>
           </rect>
          </property>
          <property name="text">
           <string>PushButton</string>
          </property>
         </widget>
         <widget class="QPushButton" name="pushButton_2">
          <property name="geometry">
           <rect>
            <x>190</x>
            <y>260</y>
            <width>75</width>
            <height>24</height>
           </rect>
          </property>
          <property name="text">
           <string>PushButton</string>
          </property>
         </widget>
        </widget>
        <widget class="QMenuBar" name="menubar">
         <property name="geometry">
          <rect>
           <x>0</x>
           <y>0</y>
           <width>658</width>
           <height>22</height>
          </rect>
         </property>
        </widget>
        <widget class="QStatusBar" name="statusbar"/>
       </widget>
       <resources/>
       <connections/>
      </ui>
      

      I also looked at your example from this link: https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/widgetbinding

      I didn't find *.ui file here. Only some xml code in the 'registerwigglywidget.py' file. I don't understand. I need to create *.ui file, then copy the xml content to registerX.py every time (if changed)?

      A Offline
      A Offline
      abir
      wrote on last edited by
      #2

      @shepard127 setting variable 'PYSIDE_DESIGNER_PLUGINS' can resolve this message.

      For example, you can set "." for the current folder.

      os.environ['PYSIDE_DESIGNER_PLUGINS'] = "."

      1 Reply Last reply
      0
      • F Offline
        F Offline
        friedemannkleint
        wrote on last edited by
        #3

        We made a change to silence the warning; it is only relevant for Qt Designer ( https://codereview.qt-project.org/c/pyside/pyside-setup/+/494171 ).

        1 Reply Last reply
        2

        • Login

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