Solved AttributeError: 'QComboBox' object has no attribute 'setPlaceholderText'
-
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! !
How can this be fixed?
Thanks -
@Cougar-0 what is the output of
python3 --version
?try execute:
sudo python3 -m pip install pyqt5==5.15.4
-
@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
-
@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-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
-
"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-0 what is the output of
python3 --version
?try execute:
sudo python3 -m pip install pyqt5==5.15.4
-
<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-0 Hello, I am using PYQT5.15.4 based on the ubuntu system, but I still encounter this problem. Is there any other solution?