I am working on a pyqt5
project in Ubuntu16.04
. To install pyqt5
, I used the command sudo apt-get install python3-pyqt5
. In Ubuntu16.04
, python3.5
comes preinstalled so initially I designed everything with python3.5
. Application was running fine.
Later I upgrade the python3.5
to python3.6
using below steps:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6
After the installation, I made sure that running python3
is invoking the python3.6
and not python3.5
:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
sudo update-alternatives --config python3
After this if I type in python3, it launches python3.6
.
Then I reinstalled all the python packages I required using sudo pip3 install <name>
(this time it was getting installed in python3 (python3.6). After this when I ran my application, it started giving me below error:
Traceback (most recent call last):
File "app.py", line 12, in <module>
from PyQt5 import QtGui, QtCore, QtWidgets, QtPrintSupport
ImportError: cannot import name 'QtGui'
With python3.5 it was working perfectly fine but with python3.6 it started showing this error. How can I resolve this issue. Thanks