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. AttributeError: 'QComboBox' object has no attribute 'setPlaceholderText'
QtWS25 Last Chance

AttributeError: 'QComboBox' object has no attribute 'setPlaceholderText'

Scheduled Pinned Locked Moved Solved Qt for Python
8 Posts 3 Posters 3.2k Views
  • 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.
  • Cougar 0C Offline
    Cougar 0C Offline
    Cougar 0
    wrote on last edited by
    #1

    I am not the developer! I am just a user trying to run a rcon tool for a game on Ubuntu 20.04. I had to install idle to set the files to use python.
    When I try to run this program ISRT_v0.8.1_Linux-Mac, python isrt.py, generates this error.

    cougarxr7@GoneSpy:~/Programs/isrt/ISRT_v0.8.1_Linux-Mac$ python3 isrt.py
    Traceback (most recent call last):
      File "isrt.py", line 3392, in <module>
        mgui = maingui()
      File "isrt.py", line 252, in __init__
        self.gui.setupUi(self)
      File "/home/cougarxr7/Programs/isrt/ISRT_v0.8.1_Linux-Mac/bin/isrt_gui.py", line 1857, in setupUi
        self.retranslateUi(ISRT_Main_Window)
      File "/home/cougarxr7/Programs/isrt/ISRT_v0.8.1_Linux-Mac/bin/isrt_gui.py", line 1866, in retranslateUi
        self.dropdown_select_server.setPlaceholderText(_translate("ISRT_Main_Window", "Select Server"))
    AttributeError: 'QComboBox' object has no attribute 'setPlaceholderText'
    cougarxr7@GoneSpy:~/Programs/isrt/ISRT_v0.8.1_Linux-Mac$ 
    

    But when I run, isrt_monitor.py, it works! !isrt_monitor.py working.png
    DBL Click opens py files.png
    python isrt.py error.png
    How can this be fixed?
    Thanks

    Cougar

    eyllanescE 1 Reply Last reply
    0
    • Cougar 0C Cougar 0

      "Cougarxr7": cougarxr7@GoneSpy:~/Desktop$ sudo apt-get install python3-pip
      [sudo] password for cougarxr7:
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      python3-pip is already the newest version (20.0.2-5ubuntu1.1).
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
      cougarxr7@GoneSpy:~/Desktop$ sudo python3 -m pip install pyqt5
      Requirement already satisfied: pyqt5 in /usr/lib/python3/dist-packages (5.14.1)
      cougarxr7@GoneSpy:~/Desktop$
      Thanks for the help!
      Still no luck.
      Please keep the suggestions coming!!!!!!!

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by eyllanesc
      #6

      @Cougar-0 what is the output of python3 --version?

      try execute:

      sudo python3 -m pip install pyqt5==5.15.4
      

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      1 Reply Last reply
      1
      • Cougar 0C Cougar 0

        I am not the developer! I am just a user trying to run a rcon tool for a game on Ubuntu 20.04. I had to install idle to set the files to use python.
        When I try to run this program ISRT_v0.8.1_Linux-Mac, python isrt.py, generates this error.

        cougarxr7@GoneSpy:~/Programs/isrt/ISRT_v0.8.1_Linux-Mac$ python3 isrt.py
        Traceback (most recent call last):
          File "isrt.py", line 3392, in <module>
            mgui = maingui()
          File "isrt.py", line 252, in __init__
            self.gui.setupUi(self)
          File "/home/cougarxr7/Programs/isrt/ISRT_v0.8.1_Linux-Mac/bin/isrt_gui.py", line 1857, in setupUi
            self.retranslateUi(ISRT_Main_Window)
          File "/home/cougarxr7/Programs/isrt/ISRT_v0.8.1_Linux-Mac/bin/isrt_gui.py", line 1866, in retranslateUi
            self.dropdown_select_server.setPlaceholderText(_translate("ISRT_Main_Window", "Select Server"))
        AttributeError: 'QComboBox' object has no attribute 'setPlaceholderText'
        cougarxr7@GoneSpy:~/Programs/isrt/ISRT_v0.8.1_Linux-Mac$ 
        

        But when I run, isrt_monitor.py, it works! !isrt_monitor.py working.png
        DBL Click opens py files.png
        python isrt.py error.png
        How can this be fixed?
        Thanks

        eyllanescE Offline
        eyllanescE Offline
        eyllanesc
        wrote on last edited by
        #2

        @Cougar-0 Are you using pyqt5 or pyside2? What version of pyqt5 or pyside2 do you use? The placeholderText property was introduced in Qt 5.15 so you must use the most recent versions of those libraries

        If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

        1 Reply Last reply
        1
        • Cougar 0C Offline
          Cougar 0C Offline
          Cougar 0
          wrote on last edited by JKSH
          #3

          @eyllanesc said in AttributeError: 'QComboBox' object has no attribute 'setPlaceholderText':

          using pyqt5 or pyside2?

          QMake version 3.1
          Using Qt version 5.12.8
          Looks like I need to update my Qt version.
          Did a search online and did not find a Qt5 update for Ubuntu 20.04??
          pyside2 is not installed on this drive, I just recently reformatted & reinstall the os.
          How can I update Qt5 to 5.15?

          Cougar

          eyllanescE 1 Reply Last reply
          0
          • Cougar 0C Cougar 0

            @eyllanesc said in AttributeError: 'QComboBox' object has no attribute 'setPlaceholderText':

            using pyqt5 or pyside2?

            QMake version 3.1
            Using Qt version 5.12.8
            Looks like I need to update my Qt version.
            Did a search online and did not find a Qt5 update for Ubuntu 20.04??
            pyside2 is not installed on this drive, I just recently reformatted & reinstall the os.
            How can I update Qt5 to 5.15?

            eyllanescE Offline
            eyllanescE Offline
            eyllanesc
            wrote on last edited by
            #4

            @Cougar-0 Uninstall pyqt5 (as it may conflict) and use pip to install pyqt5:

            sudo apt-get install python3-pip
            sudo python3 -m pip install pyqt5
            

            If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

            1 Reply Last reply
            1
            • Cougar 0C Offline
              Cougar 0C Offline
              Cougar 0
              wrote on last edited by
              #5

              "Cougarxr7": cougarxr7@GoneSpy:~/Desktop$ sudo apt-get install python3-pip
              [sudo] password for cougarxr7:
              Reading package lists... Done
              Building dependency tree
              Reading state information... Done
              python3-pip is already the newest version (20.0.2-5ubuntu1.1).
              0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
              cougarxr7@GoneSpy:~/Desktop$ sudo python3 -m pip install pyqt5
              Requirement already satisfied: pyqt5 in /usr/lib/python3/dist-packages (5.14.1)
              cougarxr7@GoneSpy:~/Desktop$
              Thanks for the help!
              Still no luck.
              Please keep the suggestions coming!!!!!!!

              Cougar

              eyllanescE X 2 Replies Last reply
              0
              • Cougar 0C Cougar 0

                "Cougarxr7": cougarxr7@GoneSpy:~/Desktop$ sudo apt-get install python3-pip
                [sudo] password for cougarxr7:
                Reading package lists... Done
                Building dependency tree
                Reading state information... Done
                python3-pip is already the newest version (20.0.2-5ubuntu1.1).
                0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
                cougarxr7@GoneSpy:~/Desktop$ sudo python3 -m pip install pyqt5
                Requirement already satisfied: pyqt5 in /usr/lib/python3/dist-packages (5.14.1)
                cougarxr7@GoneSpy:~/Desktop$
                Thanks for the help!
                Still no luck.
                Please keep the suggestions coming!!!!!!!

                eyllanescE Offline
                eyllanescE Offline
                eyllanesc
                wrote on last edited by eyllanesc
                #6

                @Cougar-0 what is the output of python3 --version?

                try execute:

                sudo python3 -m pip install pyqt5==5.15.4
                

                If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

                1 Reply Last reply
                1
                • Cougar 0C Offline
                  Cougar 0C Offline
                  Cougar 0
                  wrote on last edited by
                  #7
                  <01:35:32> "Cougar": python3 --version
                  <01:36:28> "Cougar": sudo python3 -m pip install pyqt5==5.15.4
                  <01:37:45> "Cougarxr7": cougarxr7@GoneSpy:~/Desktop$ python3 --version
                  Python 3.8.5
                  cougarxr7@GoneSpy:~/Desktop$ sudo python3 -m pip install pyqt5==5.15.4
                  [sudo] password for cougarxr7: 
                  Collecting pyqt5==5.15.4
                    Downloading PyQt5-5.15.4-cp36.cp37.cp38.cp39-abi3-manylinux2014_x86_64.whl (8.3 MB)
                       |████████████████████████████████| 8.3 MB 1.8 MB/s 
                  Collecting PyQt5-sip<13,>=12.8
                    Downloading PyQt5_sip-12.8.1-cp38-cp38-manylinux1_x86_64.whl (293 kB)
                       |████████████████████████████████| 293 kB 6.3 MB/s 
                  Collecting PyQt5-Qt5>=5.15
                    Downloading PyQt5_Qt5-5.15.2-py3-none-manylinux2014_x86_64.whl (59.9 MB)
                       |████████████████████████████████| 59.9 MB 46.0 MB/s 
                  Installing collected packages: PyQt5-sip, PyQt5-Qt5, pyqt5
                    Attempting uninstall: pyqt5
                      Found existing installation: PyQt5 5.14.1
                      Not uninstalling pyqt5 at /usr/lib/python3/dist-packages, outside environment /usr
                      Can't uninstall 'PyQt5'. No files were found to uninstall.
                  Successfully installed PyQt5-Qt5-5.15.2 PyQt5-sip-12.8.1 pyqt5-5.15.4
                  cougarxr7@GoneSpy:~/Desktop$
                  

                  That was it! The program is working!!!!!
                  Thank you!Thank you!Thank you!Thank you!Thank you!Thank you!

                  Cougar

                  1 Reply Last reply
                  0
                  • Cougar 0C Cougar 0

                    "Cougarxr7": cougarxr7@GoneSpy:~/Desktop$ sudo apt-get install python3-pip
                    [sudo] password for cougarxr7:
                    Reading package lists... Done
                    Building dependency tree
                    Reading state information... Done
                    python3-pip is already the newest version (20.0.2-5ubuntu1.1).
                    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
                    cougarxr7@GoneSpy:~/Desktop$ sudo python3 -m pip install pyqt5
                    Requirement already satisfied: pyqt5 in /usr/lib/python3/dist-packages (5.14.1)
                    cougarxr7@GoneSpy:~/Desktop$
                    Thanks for the help!
                    Still no luck.
                    Please keep the suggestions coming!!!!!!!

                    X Offline
                    X Offline
                    xinghe
                    wrote on last edited by
                    #8

                    @Cougar-0 Hello, I am using PYQT5.15.4 based on the ubuntu system, but I still encounter this problem. Is there any other solution?

                    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