(OS ist Ubuntu 18.04) Mir gefaellt nicht, dass pip /usr/local/ vollkleistert, ich moechte das unter /opt/pip/ haben. Gefunden hab ich die --prefix Option, installieren klappt schon mal: root@moep:~# pip3 install --prefix /opt/pip PySimpleGUIDesigner Collecting PySimpleGUIDesigner Using cached https://files.pythonhosted.org/packages/1e/bd/85cbde9056876f0d74889236fe2f3a... Requirement already satisfied: PySide2>=5.13 in /usr/local/lib/python3.6/dist-packages (from PySimpleGUIDesigner) Requirement already satisfied: PySimpleGUI in /usr/local/lib/python3.6/dist-packages (from PySimpleGUIDesigner) Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.6/dist-packages (from PySimpleGUIDesigner) Requirement already satisfied: shiboken2==5.15.2 in /usr/local/lib/python3.6/dist-packages (from PySide2>=5.13->PySimpleGUIDesigner) Requirement already satisfied: importlib-metadata; python_version < "3.8" in /usr/local/lib/python3.6/dist-packages (from click>=7.0->PySimpleGUIDesigner) Requirement already satisfied: typing-extensions>=3.6.4; python_version < "3.8" in /usr/local/lib/python3.6/dist-packages (from importlib-metadata; python_version < "3.8"->click>=7.0->PySimpleGUIDesigner) Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.6/dist-packages (from importlib-metadata; python_version < "3.8"->click>=7.0->PySimpleGUIDesigner) Installing collected packages: PySimpleGUIDesigner Successfully installed PySimpleGUIDesigner-0.1.4.7 root@moep:~# du /opt/pip 64 /opt/pip/lib/python3.6/site-packages/PySimpleGUIDesigner/__pycache__ 208 /opt/pip/lib/python3.6/site-packages/PySimpleGUIDesigner 28 /opt/pip/lib/python3.6/site-packages/PySimpleGUIDesigner-0.1.4.7.dist-info 236 /opt/pip/lib/python3.6/site-packages 236 /opt/pip/lib/python3.6 236 /opt/pip/lib 4 /opt/pip/bin 240 /opt/pip Aber wie geht dann uninstall? root@moep:~# pip3 uninstall --prefix /opt/pip PySimpleGUIDesigner Usage: pip uninstall [options] <package> ... pip uninstall [options] -r <requirements file> ... no such option: --prefix Auch der Aufruf klappt nicht: framstag@moep:~: /opt/pip/bin/PySimpleGUIDesigner Traceback (most recent call last): File "/opt/pip/bin/PySimpleGUIDesigner", line 7, in <module> from PySimpleGUIDesigner.main import cli ModuleNotFoundError: No module named 'PySimpleGUIDesigner' -- Ullrich Horlacher Server und Virtualisierung Rechenzentrum TIK Universitaet Stuttgart E-Mail: horlacher@tik.uni-stuttgart.de Allmandring 30a Tel: ++49-711-68565868 70569 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/
Ulli Horlacher <framstag@rus.uni-stuttgart.de> wrote:
(OS ist Ubuntu 18.04)
Mir gefaellt nicht, dass pip /usr/local/ vollkleistert, ich moechte das unter /opt/pip/ haben.
Gefunden hab ich die --prefix Option, installieren klappt schon mal:
root@moep:~# pip3 install --prefix /opt/pip PySimpleGUIDesigner Collecting PySimpleGUIDesigner Using cached https://files.pythonhosted.org/packages/1e/bd/85cbde9056876f0d74889236fe2f3a... Requirement already satisfied: PySide2>=5.13 in /usr/local/lib/python3.6/dist-packages (from PySimpleGUIDesigner) Requirement already satisfied: PySimpleGUI in /usr/local/lib/python3.6/dist-packages (from PySimpleGUIDesigner) Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.6/dist-packages (from PySimpleGUIDesigner) Requirement already satisfied: shiboken2==5.15.2 in /usr/local/lib/python3.6/dist-packages (from PySide2>=5.13->PySimpleGUIDesigner) Requirement already satisfied: importlib-metadata; python_version < "3.8" in /usr/local/lib/python3.6/dist-packages (from click>=7.0->PySimpleGUIDesigner) Requirement already satisfied: typing-extensions>=3.6.4; python_version < "3.8" in /usr/local/lib/python3.6/dist-packages (from importlib-metadata; python_version < "3.8"->click>=7.0->PySimpleGUIDesigner) Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.6/dist-packages (from importlib-metadata; python_version < "3.8"->click>=7.0->PySimpleGUIDesigner) Installing collected packages: PySimpleGUIDesigner Successfully installed PySimpleGUIDesigner-0.1.4.7
root@moep:~# du /opt/pip 64 /opt/pip/lib/python3.6/site-packages/PySimpleGUIDesigner/__pycache__ 208 /opt/pip/lib/python3.6/site-packages/PySimpleGUIDesigner 28 /opt/pip/lib/python3.6/site-packages/PySimpleGUIDesigner-0.1.4.7.dist-info 236 /opt/pip/lib/python3.6/site-packages 236 /opt/pip/lib/python3.6 236 /opt/pip/lib 4 /opt/pip/bin 240 /opt/pip
Aber wie geht dann uninstall?
root@moep:~# pip3 uninstall --prefix /opt/pip PySimpleGUIDesigner
Usage: pip uninstall [options] <package> ... pip uninstall [options] -r <requirements file> ...
no such option: --prefix
Auch der Aufruf klappt nicht:
framstag@moep:~: /opt/pip/bin/PySimpleGUIDesigner Traceback (most recent call last): File "/opt/pip/bin/PySimpleGUIDesigner", line 7, in <module> from PySimpleGUIDesigner.main import cli ModuleNotFoundError: No module named 'PySimpleGUIDesigner'
pip kennt nur die Standardorte für Packages. Wenn du andere Verzeichnisse verwendest, musst du das Python über die Environvariable PYTHONPATH mitteilen. Beispiel: pip3 install --prefix=$HOME/jodel PySimpleGUIDesigner Zum Deinstallieren: PYTHONPATH=$HOME/jodel/lib/python3.7/site-packages/ pip3 uninstall PySimpleGUIDesigner Uninstalling PySimpleGUIDesigner-0.1.4.7: Would remove: /localhome/ph/jodel/bin/PySimpleGUIDesigner /localhome/ph/jodel/lib/python3.7/site-packages/PySimpleGUIDesigner-0.1.4.7.dist-info/* /localhome/ph/jodel/lib/python3.7/site-packages/PySimpleGUIDesigner/* Proceed (y/n)? y Successfully uninstalled PySimpleGUIDesigner-0.1.4.7 pip wird dich auch darauf hingewiesen haben, daß es Binaries und Skripten in $prefix/bin installiert hat und dieses Verzeichnis nicht in $PATH ist. Das musst du also ebenfalls anpassen. Für dein Problem mit dem Dateiauswahldialog scheint es übrigens keine einfache und schöne Lösung zu geben. Die Klasse tkinter.filedialog.FileDialog hat kein natives Look and Feel wie filedialog.askopenfilename(). In tk gibt es nur entweder Dateiauswahl oder Verzeichnisauswahl und PySimpleGUI ruft nur die von tk zur Verfügung gestellten Funktionen auf. Du müsstest also deinen Fileselector komplett neu schreiben. Am einfachsten scheint mir dabei die Verwendung von tkinter.ttk.Treeview. Ob ein anderes Toolkit, z.B. gtk, einen passenden Dialog bietet, kann ich nicht sagen. Tkinter hat aber den Vorteil, daß es bei Python unter allen Plattformen verfügbar ist. -- Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de
Peter Heitzer <peter.heitzer@rz.uni-regensburg.de> wrote:
Mir gefaellt nicht, dass pip /usr/local/ vollkleistert, ich moechte das unter /opt/pip/ haben.
Gefunden hab ich die --prefix Option, installieren klappt schon mal:
root@moep:~# pip3 install --prefix /opt/pip PySimpleGUIDesigner
framstag@moep:~: /opt/pip/bin/PySimpleGUIDesigner Traceback (most recent call last): File "/opt/pip/bin/PySimpleGUIDesigner", line 7, in <module> from PySimpleGUIDesigner.main import cli ModuleNotFoundError: No module named 'PySimpleGUIDesigner'
pip kennt nur die Standardorte für Packages. Wenn du andere Verzeichnisse verwendest, musst du das Python über die Environvariable PYTHONPATH mitteilen.
Prima, der Aufruf klappt so: PYTHONPATH=/opt/pip/lib/python3.6/site-packages /opt/pip/bin/PySimpleGUIDesigner Schon mal gut :-)
Zum Deinstallieren: PYTHONPATH=$HOME/jodel/lib/python3.7/site-packages/ pip3 uninstall PySimpleGUIDesigner Uninstalling PySimpleGUIDesigner-0.1.4.7:
Leider funktioniert das bei mir nicht: root@moep:~# PYTHONPATH=/opt/pip/lib/python3.6/site-packages pip3 uninstall /opt/pip PySimpleGUIDesigner Directory '/opt/pip' is not installable. File 'setup.py' not found. root@moep:~# du /opt/pip/lib/python3.6/site-packages 64 /opt/pip/lib/python3.6/site-packages/PySimpleGUIDesigner/__pycache__ 208 /opt/pip/lib/python3.6/site-packages/PySimpleGUIDesigner 28 /opt/pip/lib/python3.6/site-packages/PySimpleGUIDesigner-0.1.4.7.dist-info 236 /opt/pip/lib/python3.6/site-packages
Für dein Problem mit dem Dateiauswahldialog scheint es übrigens keine einfache und schöne Lösung zu geben. Die Klasse tkinter.filedialog.FileDialog hat kein natives Look and Feel wie filedialog.askopenfilename(). In tk gibt es nur entweder Dateiauswahl oder Verzeichnisauswahl und PySimpleGUI ruft nur die von tk zur Verfügung gestellten Funktionen auf.
Ist nicht ganz so tragisch, ich hab jetzt zwei Buttuns implementiert, einen fuer [add a file] und einen fuer [add a directory] Meine User muessen halt lernen, was der Unterschied ist :-} -- Ullrich Horlacher Server und Virtualisierung Rechenzentrum TIK Universitaet Stuttgart E-Mail: horlacher@tik.uni-stuttgart.de Allmandring 30a Tel: ++49-711-68565868 70569 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/
Ulli Horlacher <framstag@rus.uni-stuttgart.de> wrote:
Peter Heitzer <peter.heitzer@rz.uni-regensburg.de> wrote:
Mir gefaellt nicht, dass pip /usr/local/ vollkleistert, ich moechte das unter /opt/pip/ haben.
Gefunden hab ich die --prefix Option, installieren klappt schon mal:
root@moep:~# pip3 install --prefix /opt/pip PySimpleGUIDesigner
framstag@moep:~: /opt/pip/bin/PySimpleGUIDesigner Traceback (most recent call last): File "/opt/pip/bin/PySimpleGUIDesigner", line 7, in <module> from PySimpleGUIDesigner.main import cli ModuleNotFoundError: No module named 'PySimpleGUIDesigner'
pip kennt nur die Standardorte für Packages. Wenn du andere Verzeichnisse verwendest, musst du das Python über die Environvariable PYTHONPATH mitteilen.
Prima, der Aufruf klappt so:
PYTHONPATH=/opt/pip/lib/python3.6/site-packages /opt/pip/bin/PySimpleGUIDesigner
Schon mal gut :-)
Zum Deinstallieren: PYTHONPATH=$HOME/jodel/lib/python3.7/site-packages/ pip3 uninstall PySimpleGUIDesigner Uninstalling PySimpleGUIDesigner-0.1.4.7:
Leider funktioniert das bei mir nicht:
root@moep:~# PYTHONPATH=/opt/pip/lib/python3.6/site-packages pip3 uninstall /opt/pip PySimpleGUIDesigner Directory '/opt/pip' is not installable. File 'setup.py' not found. Du musst das '/opt/pip' nach uninstall weglassen. Durch PYTHONPATH hast du ja pip schon gesagt, wo es nach Paketen suchen soll.
-- Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de
Peter Heitzer <peter.heitzer@rz.uni-regensburg.de> wrote:
Zum Deinstallieren: PYTHONPATH=$HOME/jodel/lib/python3.7/site-packages/ pip3 uninstall PySimpleGUIDesigner Uninstalling PySimpleGUIDesigner-0.1.4.7:
Leider funktioniert das bei mir nicht:
root@moep:~# PYTHONPATH=/opt/pip/lib/python3.6/site-packages pip3 uninstall /opt/pip PySimpleGUIDesigner Directory '/opt/pip' is not installable. File 'setup.py' not found. Du musst das '/opt/pip' nach uninstall weglassen.
ARGH! Das hatte ich total uebersehen. Ja, klar! Jetzt klappt auch das uninstall! Ich hab allerdings noch in /usr/local/bin einige files von vorherigen pip Installationen, zB: root@moep:/usr/local/bin# l psg* -RWX 244 2021-11-08 10:40 psghelp -RWX 262 2021-11-08 10:40 psgissue -RWX 252 2021-11-08 10:40 psgmain -RWX 282 2021-11-08 10:40 psgsettings -RWX 258 2021-11-08 10:40 psgupgrade -RWX 256 2021-11-08 10:40 psgver Die wuerde ich nun gerne sauber deinstallieren und neu unter /opt/pip installieren. Problem: wie finde ich heraus zu welchem Paket die gehoeren? -- Ullrich Horlacher Server und Virtualisierung Rechenzentrum TIK Universitaet Stuttgart E-Mail: horlacher@tik.uni-stuttgart.de Allmandring 30a Tel: ++49-711-68565868 70569 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/
Ulli Horlacher <framstag@rus.uni-stuttgart.de> wrote:
Peter Heitzer <peter.heitzer@rz.uni-regensburg.de> wrote:
Zum Deinstallieren: PYTHONPATH=$HOME/jodel/lib/python3.7/site-packages/ pip3 uninstall PySimpleGUIDesigner Uninstalling PySimpleGUIDesigner-0.1.4.7:
Leider funktioniert das bei mir nicht:
root@moep:~# PYTHONPATH=/opt/pip/lib/python3.6/site-packages pip3 uninstall /opt/pip PySimpleGUIDesigner Directory '/opt/pip' is not installable. File 'setup.py' not found. Du musst das '/opt/pip' nach uninstall weglassen.
ARGH! Das hatte ich total uebersehen. Ja, klar!
Jetzt klappt auch das uninstall!
Ich hab allerdings noch in /usr/local/bin einige files von vorherigen pip Installationen, zB:
root@moep:/usr/local/bin# l psg* -RWX 244 2021-11-08 10:40 psghelp -RWX 262 2021-11-08 10:40 psgissue -RWX 252 2021-11-08 10:40 psgmain -RWX 282 2021-11-08 10:40 psgsettings -RWX 258 2021-11-08 10:40 psgupgrade -RWX 256 2021-11-08 10:40 psgver
Die wuerde ich nun gerne sauber deinstallieren und neu unter /opt/pip installieren. Problem: wie finde ich heraus zu welchem Paket die gehoeren? Ich würde mal pip -v list bemühen. Das zeigt dir an, welche Pakete wo installiert sind. psg* schaut nach pysimplegui aus.
-- Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de
participants (2)
-
Peter Heitzer -
Ulli Horlacher