Seite 1 von 2

Installation und Download von qt (für Linux)

Verfasst: Donnerstag 28. Februar 2019, 19:53
von Cortez
Hallo,

kann mir jemand sagen, wo man das qt für die GUI-Programmierung am besten herunterlädt. Die Links, die ich bisher gefunden habe, führten alle ins Nichts. Da ich Linux-User bin, bräuchte ich eine Seite, die die Linux-Version anbietet.

Ich danke schonmal herzlich.

Re: Installation und Download von qt (für Linux)

Verfasst: Donnerstag 28. Februar 2019, 19:55
von sparrow
Äääh. Aus deiner Paketverwaltung?

Re: Installation und Download von qt (für Linux)

Verfasst: Donnerstag 28. Februar 2019, 20:14
von Cortez
Oh (rot werd). Da hätte ich auch selber drauf kommen können.
Anyway, wenn man da nach qt sucht, erhält man recht viel. Ich habe mir mal eines rausgesucht(python-qt-binding), das folgende Beschreibung erhält. Wenn mich meine kümmerlichen Englischkenntnisse nicht täuschen, müsste das das richtige für Python sein, oder?
This package is part of Robot OS (ROS). It provides Python bindings
for Qt. There are two providers: pyside and pyqt. PySide is released
under the LGPL. PyQt is released under the GPL.

Both the bindings and tools to build bindings are included from each
available provider. For PySide, it is called "Shiboken". For PyQt,
this is called "SIP".

Also provided is adapter code to make the user's Python code
independent of which binding provider was actually used which makes
it very easy to switch between these.

Re: Installation und Download von qt (für Linux)

Verfasst: Donnerstag 28. Februar 2019, 20:15
von sparrow
Was für eine Distribution verwendest du denn?

Re: Installation und Download von qt (für Linux)

Verfasst: Donnerstag 28. Februar 2019, 22:13
von __blackjack__
@Cortez: Jain, das ist zwar eine Qt-Anbindung aber ein bisschen ”Meta”. Das ist noch mal eine Abstraktionsschicht bei der man wählen kann ob man PyQt oder PySide als Python-Anbindung verwendet. Ich würde da ja direkt eine der beiden Alternativen verwenden, anstatt da noch mal etwas drüber zu setzen.

Re: Installation und Download von qt (für Linux)

Verfasst: Donnerstag 28. Februar 2019, 22:50
von Tholo
ROS ist bestimmt nicht das richtige für dich! Das ist ein Roboter Framework
Alles Distro welche ich nutze (Arch, Ubuntu) haben QT schon drauf. Ein Install via "pip install pyside2" war meine ganze Arbeit. Das verwundert mich gerade etwas.

Ansonsten hier Pyside2 from scratch

Re: Installation und Download von qt (für Linux)

Verfasst: Donnerstag 28. Februar 2019, 23:46
von Cortez
Meine Distribution ist Linux Mint.
Ich frage nur, weil es in der einschlägigen Literatur heißt, dass man das installarieren müsse (habe ich jedenfalls so verstanden...

Re: Installation und Download von qt (für Linux)

Verfasst: Sonntag 3. März 2019, 13:12
von Cortez
Entschuldigung, dass ich jetzt erst antworte. Also ich habe das mit dem pip mal pyside2 installiert - das hat auch geklappt.
Zudem habe ich folgende Pakete noch installiert:

Code: Alles auswählen

sudo apt-get install python3-pyqt5
sudo apt-get install pyqt5-dev-tools
sudo apt-get install qttools5-dev-tools
Es sind jetzt auch folgende Programme in meinem Menü verfügbar: Qt5Assistant, Qt5Designer und Qt5Linguist.

Wenn ich allerdings zu programmieren anfangen möchte und in meine Umgebung folgendes z.B. eingebe:
from PyQt5.QtWidgets import QApplication, QWidget

erhalte ich die Meldung, dass kein Modul mit dem Namen PyQt5 vorhanden ist.
Muss ich den Sourcecode erst noch runterladen und kompilieren? Und wenn ja, in welches Verzeichnis müsste der Code kompiliert werden? Oder was könnte ansonsten der Grund sein, dass das noch nicht klappt?

Re: Installation und Download von qt (für Linux)

Verfasst: Sonntag 3. März 2019, 13:21
von __deets__
Und du benutzt auch Python 3? Denn dafür hast du das installiert.

Re: Installation und Download von qt (für Linux)

Verfasst: Sonntag 3. März 2019, 13:23
von Cortez
Genau, wenn ich python3 -V eingebe, erhalte ich eine Ausgabe: Python3.7.2

Und zu Beginn meiner Programme schreibe ich auch immer folgende Zeile, um python3 zu nehmen:

#!/usr/src/Python-3.7.2/python

Re: Installation und Download von qt (für Linux)

Verfasst: Sonntag 3. März 2019, 13:28
von __deets__
Das sieht falsch aus, weil es ein ungewöhnlicher Pfad und augenscheinlich selbstkompliliertes Python ist. Dahin kann die system-Paket-Verwaltung nichts installieren. Du musst /usr/bin/python3 benutzen. Für das wurden die Pakete installiert.

Re: Installation und Download von qt (für Linux)

Verfasst: Sonntag 3. März 2019, 13:36
von Cortez
Also das heißt, ich muss diesen Pfad in meine Programme einfügen, dass Qt5 erkannt wird. Und du meinst wohl /usr/bin/python3.7 - dieses Verzeichnis existiert bei mir... Oder muss ich es umbenennen?

Obwohl Vereichnisse sinds ja gar, nur Dateien. Ups...

Re: Installation und Download von qt (für Linux)

Verfasst: Sonntag 3. März 2019, 13:53
von __deets__
Ich meine vor allem erstmal das Python3, fuer das wiederum die Pakete, die du oben installiert hast, gemeint sind. Das *kann* python3.7 sein, aber ob es das ist kann ich nicht beurteilen. Bei meinen Linux-Rechnern ist das "standard" python3 eben /usr/bin/python3. Und da sollten dann die importe klappen. Du kannst dir ja auch mal die Inhalte der Pakete die du installiert hast anzeigen lassen, und daraus ggf. darauf schliessen, welches Python gemeint ist.

Re: Installation und Download von qt (für Linux)

Verfasst: Sonntag 3. März 2019, 14:31
von Cortez
Also ich habe jetzt sowwohl mal /usr/bin/python3, als auch usr/bin/python3.7 hingeschrieben. Ergebnis blieb jedesmal das Gleiche. Ich hab mir mal sämtliche Python-Dateien im /usr/bin anzeigen lassen. Vielleicht hilft das ja weiter...

Code: Alles auswählen

/usr/bin$ ll| grep python
-rwxr-xr-x 1 root root       1056 Apr 16  2018 dh_python2
lrwxrwxrwx 1 root root         23 Nov 12 15:31 pdb2.7 -> ../lib/python2.7/pdb.py
lrwxrwxrwx 1 root root         23 Okt 22 13:32 pdb3.6 -> ../lib/python3.6/pdb.py
lrwxrwxrwx 1 root root         23 Okt 22 13:21 pdb3.7 -> ../lib/python3.7/pdb.py
lrwxrwxrwx 1 root root         31 Okt 25 13:11 py3versions -> ../share/python3/py3versions.py
lrwxrwxrwx 1 root root          9 Nov 17 14:07 python -> python2.7
lrwxrwxrwx 1 root root          9 Nov 17 14:07 python2 -> python2.7
-rwxr-xr-x 1 root root    3670448 Nov 12 15:31 python2.7
lrwxrwxrwx 1 root root         33 Nov 12 15:31 python2.7-config -> x86_64-linux-gnu-python2.7-config
lrwxrwxrwx 1 root root         16 Apr 16  2018 python2-config -> python2.7-config
-rwxr-xr-x 1 root root        154 Nov 11  2017 python2-pbr
lrwxrwxrwx 1 root root          9 Okt 25 13:11 python3 -> python3.6
-rwxr-xr-x 2 root root    4522328 Okt 22 13:32 python3.6
-rwxr-xr-x 2 root root    4522328 Okt 22 13:32 python3.6m
-rwxr-xr-x 2 root root    4857312 Okt 22 13:21 python3.7
-rwxr-xr-x 2 root root    4857312 Okt 22 13:21 python3.7m
lrwxrwxrwx 1 root root         10 Okt 25 13:11 python3m -> python3.6m
lrwxrwxrwx 1 root root         16 Apr 16  2018 python-config -> python2.7-config
lrwxrwxrwx 1 root root         29 Nov 17 14:07 pyversions -> ../share/python/pyversions.py
-rwxr-xr-x 1 root root       2975 Nov 12 15:31 x86_64-linux-gnu-python2.7-config
lrwxrwxrwx 1 root root         33 Apr 16  2018 x86_64-linux-gnu-python-config -> x86_64-linux-gnu-python2.7-config

Re: Installation und Download von qt (für Linux)

Verfasst: Sonntag 3. März 2019, 14:33
von __deets__
Interessanter sind die Inhalte von python3-pyqt5. Und du kannst auch mal python3.6 probieren. Ob es damit geht.

Re: Installation und Download von qt (für Linux)

Verfasst: Sonntag 3. März 2019, 14:40
von Cortez
Das habe ich auch schon probiert (python 3.6). Geht auch nicht... Wie kann ich die Inhalte von python3-pyqt5 anzeigen lassen?

Re: Installation und Download von qt (für Linux)

Verfasst: Sonntag 3. März 2019, 14:49
von __deets__
Mit dpkg -L paketname oder so. Das kann man aber auch ganz einfach selbst ergoogeln.

Re: Installation und Download von qt (für Linux)

Verfasst: Sonntag 3. März 2019, 14:57
von Cortez
Ok, ergibt folgendes:

Code: Alles auswählen

dpkg -L python3-pyqt5
/.
/usr
/usr/lib
/usr/lib/python3
/usr/lib/python3/dist-packages
/usr/lib/python3/dist-packages/PyQt5
/usr/lib/python3/dist-packages/PyQt5/Qt.cpython-36m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-36m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt5/QtCore.pyi
/usr/lib/python3/dist-packages/PyQt5/QtDBus.cpython-36m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt5/QtDBus.pyi
/usr/lib/python3/dist-packages/PyQt5/QtDesigner.cpython-36m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt5/QtDesigner.pyi
/usr/lib/python3/dist-packages/PyQt5/QtGui.cpython-36m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt5/QtGui.pyi
/usr/lib/python3/dist-packages/PyQt5/QtHelp.cpython-36m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt5/QtHelp.pyi
/usr/lib/python3/dist-packages/PyQt5/QtNetwork.cpython-36m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt5/QtNetwork.pyi
/usr/lib/python3/dist-packages/PyQt5/QtPrintSupport.cpython-36m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt5/QtPrintSupport.pyi
/usr/lib/python3/dist-packages/PyQt5/QtTest.cpython-36m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt5/QtTest.pyi
/usr/lib/python3/dist-packages/PyQt5/QtWidgets.cpython-36m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt5/QtWidgets.pyi
/usr/lib/python3/dist-packages/PyQt5/QtXml.cpython-36m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/PyQt5/QtXml.pyi
/usr/lib/python3/dist-packages/PyQt5/__init__.py
/usr/lib/python3/dist-packages/PyQt5/uic
/usr/lib/python3/dist-packages/PyQt5/uic/Compiler
/usr/lib/python3/dist-packages/PyQt5/uic/Compiler/__init__.py
/usr/lib/python3/dist-packages/PyQt5/uic/Compiler/compiler.py
/usr/lib/python3/dist-packages/PyQt5/uic/Compiler/indenter.py
/usr/lib/python3/dist-packages/PyQt5/uic/Compiler/misc.py
/usr/lib/python3/dist-packages/PyQt5/uic/Compiler/proxy_metaclass.py
/usr/lib/python3/dist-packages/PyQt5/uic/Compiler/qobjectcreator.py
/usr/lib/python3/dist-packages/PyQt5/uic/Compiler/qtproxies.py
/usr/lib/python3/dist-packages/PyQt5/uic/Loader
/usr/lib/python3/dist-packages/PyQt5/uic/Loader/__init__.py
/usr/lib/python3/dist-packages/PyQt5/uic/Loader/loader.py
/usr/lib/python3/dist-packages/PyQt5/uic/Loader/qobjectcreator.py
/usr/lib/python3/dist-packages/PyQt5/uic/__init__.py
/usr/lib/python3/dist-packages/PyQt5/uic/driver.py
/usr/lib/python3/dist-packages/PyQt5/uic/exceptions.py
/usr/lib/python3/dist-packages/PyQt5/uic/icon_cache.py
/usr/lib/python3/dist-packages/PyQt5/uic/objcreator.py
/usr/lib/python3/dist-packages/PyQt5/uic/port_v3
/usr/lib/python3/dist-packages/PyQt5/uic/port_v3/__init__.py
/usr/lib/python3/dist-packages/PyQt5/uic/port_v3/as_string.py
/usr/lib/python3/dist-packages/PyQt5/uic/port_v3/ascii_upper.py
/usr/lib/python3/dist-packages/PyQt5/uic/port_v3/proxy_base.py
/usr/lib/python3/dist-packages/PyQt5/uic/port_v3/string_io.py
/usr/lib/python3/dist-packages/PyQt5/uic/properties.py
/usr/lib/python3/dist-packages/PyQt5/uic/pyuic.py
/usr/lib/python3/dist-packages/PyQt5/uic/uiparser.py
/usr/lib/python3/dist-packages/PyQt5/uic/widget-plugins
/usr/lib/python3/dist-packages/PyQt5/uic/widget-plugins/.noinit
/usr/lib/python3/dist-packages/PyQt5/uic/widget-plugins/qaxcontainer.py
/usr/lib/python3/dist-packages/PyQt5/uic/widget-plugins/qscintilla.py
/usr/lib/python3/dist-packages/PyQt5/uic/widget-plugins/qtcharts.py
/usr/lib/python3/dist-packages/PyQt5/uic/widget-plugins/qtprintsupport.py
/usr/lib/python3/dist-packages/PyQt5/uic/widget-plugins/qtquickwidgets.py
/usr/lib/python3/dist-packages/PyQt5/uic/widget-plugins/qtwebenginewidgets.py
/usr/lib/python3/dist-packages/PyQt5/uic/widget-plugins/qtwebkit.py
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/qt5
/usr/lib/x86_64-linux-gnu/qt5/plugins
/usr/lib/x86_64-linux-gnu/qt5/plugins/designer
/usr/lib/x86_64-linux-gnu/qt5/plugins/designer/libpyqt5.so
/usr/share
/usr/share/doc
/usr/share/doc/python3-pyqt5
/usr/share/doc/python3-pyqt5/changelog.Debian.gz
/usr/share/doc/python3-pyqt5/copyright
achja, wenn ich python über die Kommandozeile starte, kann ich das auch nicht importiere.
Also: import sys z.B. geht, aber bei import PyQt5 kommt die gleiche Fehlermeldung.

Re: Installation und Download von qt (für Linux)

Verfasst: Sonntag 3. März 2019, 15:05
von __deets__
Also da sowas hier

/usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-36m-x86_64-linux-gnu.so

klar macht, dass es python3.6 sein muss, wuerde ich dich mal bitten

Code: Alles auswählen

python3.6 -c 'import PyQt5.QtCore' 
auszufuehren, auf der Kommandozeile. Und das Ergebnis hier teilen.

Re: Installation und Download von qt (für Linux)

Verfasst: Sonntag 3. März 2019, 15:13
von Cortez
Also Ergebnis kam da jetzt gar keines. Hab das Ganze allerdings ohne das -c Flag gemacht. Wenn ich das Ganze so kopiere, wie du das geschrieben hast, komme ich in so eine Art Eingabeaufforderung (ein Pfeil am Anfang der Zeile). Wenn ich das Ganze mit strg + d abbreche erhalte ich die Meldung:"bash: Dateiende beim Suchen nach »'« erreicht.
bash: Syntaxfehler: Unerwartetes Dateiende.