pip3 install --user pyqt5
sudo apt-get install python3-pyqt5
sudo apt-get install pyqt5-dev-tools
sudo apt-get install qttools5-dev-tools
$ qtchooser -run-tool=designer -qt=5
OR
Write the following in /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf
/usr/lib/x86_64-linux-gnu/qt5/bin
/usr/lib/x86_64-linux-gnu
Create uic.py file.
#!/usr/bin/python3
import subprocess
import sys
child = subprocess.Popen(['pyuic5' ,'-x',sys.argv[1]],stdout=subprocess.PIPE)
print(str(child.communicate()[0],encoding='utf-8'))
$ chmod +x uic.py
Create a symlink:
$ sudo ln uic.py "/usr/lib/x86_64-linux-gnu/qt5/bin/uic"
[Desktop Entry]
Name=Qt5 Designer
Icon=designer
Exec=/usr/lib/x86_64-linux-gnu/qt5/bin/designer
Type=Application
Categories=Application
Terminal=false
StartupNotify=true
Actions=NewWindow
Name[en_US]=Qt5 Designer
[Desktop Action NewWindow]
Name=Open a New Window
Exec=/usr/lib/x86_64-linux-gnu/qt5/bin/designer
save in ~/.local/share/application with .desktop extension
So, from the point of view of running python within a virtual environment, it is very likely that all steps to get pyqt5 will work, except the bit that used to bring qt-designer in. If the system has Qt5 installed, it seems to have all the libraries required for it installed too and even if you don't have
pyqt5
installed on the base system, theqtchooser
way of launching qtdesigner from above will work.Therefore, a key component here is qtchooser.
The compiler will become available immediately within the virtualenv once you install pyqt5 there.
It would be great if the settings to launch the designer (in terms of setting up environment variables) where applied by one of the pip packages :/