Unable to activate plugin under Linux Mint

#459 · closed · 3 comments

View on GitHub ↗

ktrinko

**Describe the bug** Trying to activate the plugin version 4.5.1 by clicking the checkbox an error-message appears system: Linux mint 22.3 qgis 4.2.1 (flatpak) error-message: Couldn't load plugin 'DataPlotly' due to an error when calling its classFactory() method ModuleNotFoundError: No module named 'plotly' Traceback (most recent call last): File "/app/share/qgis/python/qgis/utils.py", line 496, in _startPlugin plugins[packageName] = package.classFactory(iface) ~~~~~~~~~~~~~~~~~~~~^^^^^^^ File "/home/kurt/.var/app/org.qgis.qgis/data/QGIS/QGIS4/profiles/qgis4-test/python/plugins/DataPlotly/__init__.py", line 33, in classFactory from .data_plotly import DataPlotly File "/app/share/qgis/python/qgis/utils.py", line 1119, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "/home/kurt/.var/app/org.qgis.qgis/data/QGIS/QGIS4/profiles/qgis4-test/python/plugins/DataPlotly/data_plotly.py", line 35, in from DataPlotly.gui.dock import DataPlotlyDockManager File "/app/share/qgis/python/qgis/utils.py", line 1119, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "/home/kurt/.var/app/org.qgis.qgis/data/QGIS/QGIS4/profiles/qgis4-test/python/plugins/DataPlotly/gui/dock.py", line 19, in from DataPlotly.gui.plot_settings_widget import DataPlotlyPanelWidget File "/app/share/qgis/python/qgis/utils.py", line 1119, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "/home/kurt/.var/app/org.qgis.qgis/data/QGIS/QGIS4/profiles/qgis4-test/python/plugins/DataPlotly/gui/plot_settings_widget.py", line 81, in from DataPlotly.core.plot_factory import PlotFactory File "/app/share/qgis/python/qgis/utils.py", line 1119, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "/home/kurt/.var/app/org.qgis.qgis/data/QGIS/QGIS4/profiles/qgis4-test/python/plugins/DataPlotly/core/plot_factory.py", line 14, in import plotly File "/app/share/qgis/python/qgis/utils.py", line 1119, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ModuleNotFoundError: No module named 'plotly' Python version: 3.13.14 (main, Nov 10 2011, 15:00:00) [GCC 15.2.0] QGIS version: 4.2.1-Belém do Pará Belém do Pará, exported Python Path: /home/kurt/.var/app/org.qgis.qgis/data/QGIS/QGIS4/profiles/qgis4-test/python/plugins/GeoSpreadsheet/_vendor /home/kurt/.var/app/org.qgis.qgis/data/QGIS/QGIS4/profiles/qgis4-test/python/plugins/WaterNetAnalyzer-master /app/share/qgis/python /home/kurt/.var/app/org.qgis.qgis/data/QGIS/QGIS4/profiles/qgis4-test/python /home/kurt/.var/app/org.qgis.qgis/data/QGIS/QGIS4/profiles/qgis4-test/python/plugins /app/share/qgis/python/plugins /usr/lib/python313.zip /usr/lib/python3.13 /usr/lib/python3.13/lib-dynload /app/lib/python3.13/site-packages /usr/lib/python3.13/site-packages /home/kurt/.var/app/org.qgis.qgis/data/QGIS/QGIS4/profiles/qgis4-test/python /home/kurt/.var/app/org.qgis.qgis/data/QGIS/QGIS4/profiles/qgis4-test/python/plugins/FeatureGridCreator

Comments

ghtmtt

@ktrinko you have to install `plotly` separately. For linux system (debian based like mint) you just need `apt install python3-plotly`

ktrinko

Thank you for the hint, as I use flatpak it was a bit more complicated: DataPlotly unter QGIS 4 Flatpak – fehlende Python-Abhängigkeiten installieren Bei QGIS als Flatpak kann apt install python3-plotly nicht verwendet werden, da das Mint-System-Python außerhalb der Flatpak-Sandbox liegt. 1. Verwendete QGIS-Runtime prüfen: flatpak info org.qgis.qgis --show-runtime Beispiel: org.kde.Platform/x86_64/6.10 2. Passendes KDE SDK installieren: flatpak install flathub org.kde.Sdk//6.10 3. Prüfen, ob pip innerhalb des QGIS-Flatpaks verfügbar ist: flatpak run --devel --command=pip3 org.qgis.qgis --version 4. Plotly im Benutzerbereich des QGIS-Flatpaks installieren: flatpak run --devel --command=pip3 org.qgis.qgis install --user plotly 5. Pandas ebenfalls installieren (wird für die DataPlotly-Processing-Algorithmen benötigt): flatpak run --devel --command=pip3 org.qgis.qgis install --user pandas 6. Installation überprüfen: flatpak run --devel --command=python3 org.qgis.qgis -c "import pandas, plotly; print('pandas:', pandas.__version__); print('plotly:', plotly.__version__)" Bei erfolgreicher Installation sollten die Versionen ausgegeben werden. 7. QGIS neu starten. Danach sollten die DataPlotly-Processing-Algorithmen in der Processing Toolbox verfügbar sein. Wichtig Diese Methode installiert die Python-Pakete im Benutzerbereich des QGIS-Flatpaks und verändert nicht das Python-System von Linux Mint. Es ist daher kein sudo apt install python3-plotly und insbesondere kein pip install --break-system-packages für das System-Python erforderlich. Bei unserem Setup wurden die Pakete hier abgelegt: /var/data/python/lib/python3.13/site-packages/ Hinweis zu HTML-Ausgaben DataPlotly kann Processing-Ergebnisse als temporäre HTML-Datei unter /tmp/processing_... erzeugen. Bei QGIS als Flatpak kann diese Datei für den normalen Dateimanager/Browser außerhalb der Sandbox nicht direkt sichtbar sein. Das bedeutet nicht, dass DataPlotly nicht funktioniert. Die HTML-Datei kann innerhalb der Flatpak-Umgebung vorhanden sein, obwohl sie im normalen /tmp von Linux Mint nicht auftaucht. Credit-Hinweis: Installation procedure developed/tested with assistance from ChatGPT (OpenAI), on Linux Mint 22.3 with QGIS 4.2.1 Flatpak, KDE Platform 6.10 and Python 3.13.

ghtmtt

thanks for the answer. If you have solved, please close the issue!