Forked from r00tdaemon/Install PyQt5 on Ubuntu with python3 .md
Created
June 3, 2020 01:49
-
-
Save shoukreytom/06b36a59b22273ce37bf7e6d0456093c to your computer and use it in GitHub Desktop.
Revisions
-
r00tdaemon revised this gist
Jun 21, 2018 . No changes.There are no files selected for viewing
-
r00tdaemon renamed this gist
Jun 28, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
r00tdaemon created this gist
Jun 26, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,66 @@ ## Installation ``` pip3 install --user pyqt5 sudo apt-get install python3-pyqt5 sudo apt-get install pyqt5-dev-tools sudo apt-get install qttools5-dev-tools ``` ____ ## Configuring to run from terminal `$ 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 ``` ____ ## Code Generation **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 ``` [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**