Install PyQt5 5.14.1 on Linux" → "Install PyQt5 5.14.1 on Linux

Issue Summary

I am trying to install PyQt5 and PyQtChart on Python 3.6.9, but I am getting a ModuleNotFoundError: No module named 'PyQt5.sip' error when I try to import PyQt5.QtCore. I have tried both pip3 and downloading the zip folder, but neither of those have worked. My end goal is to run a candlestick chart using PyQt5.

pip3 install PyQt5
pip3 install PyQt5.sip
pip3 install sip
pip3 install PyQtChart
sudo python3 -m pip install pyqt5 pyqtchart

The error you are encountering is likely due to a missing or misconfigured installation of PyQt5. To resolve this issue, you can try the following steps:

  1. First, make sure you have the latest version of pip installed by running pip install --upgrade pip.

  2. Uninstall PyQt5, PyQtChart, and sip (if installed) by running the following commands:

pip uninstall PyQt5
pip uninstall PyQtChart
pip uninstall sip
  1. Install PyQt5 and PyQtChart using the pyqt5 and pyqtchart packages from the official Python Package Index (PyPI):
pip install pyqt5
pip install pyqtchart
  1. If the above step does not work, you can try installing PyQt5 and PyQtChart using the apt package manager (for Ubuntu/Debian-based systems):
sudo apt-get install python3-pyqt5
sudo apt-get install python3-pyqt5.qtchart
  1. Once the installations are complete, try importing PyQt5.QtCore in your Python script again. It should work without any ModuleNotFoundError.

If you are still facing issues, it’s possible that there is a problem with your Python environment. In that case, you may want to consider creating a virtual environment and installing PyQt5 and PyQtChart within it to isolate your dependencies.

Note: Make sure you are using the correct Python interpreter when running the pip commands. If you have multiple versions of Python installed, you might need to use pip3 instead of pip to ensure the packages are installed for Python 3.