0

I get this error each time I try to install PyQt5 on PyCharm

Error

So I try running the executed command from the system terminal as suggested in the screenshot and get this.

zsh: command not found: pip

I use this this command instead

python3 -m pip install PyQt5

and it shows as already installed

However, in PyCharm, PyQt5 is still undetected.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Sher
  • 1
  • I am trying through IntelliJ now and I get this issue: "Installing packages into 'Python 3.8' requires administrator privileges". I have macOS – Sher Nov 20 '21 at 15:28
  • Did you try using the `Python Packages` tab in Pycharm? (it's along the bottom of the window) – Alec Petersen Oct 19 '22 at 18:07

1 Answers1

0

enter the following code in your terminal

"pip install pyqt5 pyqt5-tools"

Test if pqyt5 is actually installed Create a new file, example.py, and enter the following code.

import sys    
from PyQt5 import QtWidgets, QtCore  

app = QtWidgets.QApplication(sys.argv)  
widget = QtWidgets.QWidget()  
widget.resize(400, 200)  
widget.setWindowTitle("This is PyQt Widget example")  
widget.show()        
exit(app.exec_()) 

Read this Article below I think it's very helpful that's is where i got my knowledge https://pythonpyqt.com/how-to-install-pyqt5-in-pycharm/

  • I tried `pip3 install pyqt5 pyqt5-tools` and it gave me loads of error and got stuck on "loading metadata". When I try `python3 -m pip install PyQt5`, it states that it's already installed. I looked for the package and found that it was installed in a folder named Python3.9 while my IDE install packages to a folder named Python3.8, I'm not sure what that means but I'm guessing it's related to the issue. – Sher Nov 20 '21 at 18:31
  • I managed to somehow install PyQt5 and other dependent packages; however, when I run the code you provided me, I get this error: `(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/QtWidgets.abi3.so' (no such file), '/usr/lib/QtWidgets.abi3.so' (no such file)` – Sher Nov 20 '21 at 18:54