
Ich verwende Ubuntu 20.04.2 LTS.
Wenn ich Jupyter-Notebook im Terminal öffnen möchte, öffnet sich die Telegram-Desktop-App.
Das Jupyter-Notebook ist tatsächlich im Hintergrund geöffnet. Ich kann also den Browser öffnen und es verwenden.
Hier ist die Ausgabe:
(geospatial) siavash@siavash-fra:~$ jupyter-notebook
[I 16:59:52.522 NotebookApp] Serving notebooks from local directory: /home/siavash
[I 16:59:52.522 NotebookApp] The Jupyter Notebook is running at:
[I 16:59:52.522 NotebookApp] http://localhost:8888/?token=192817dbf13703bc25bbd1f348df5e9c1c7c9275d579aef3
[I 16:59:52.522 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 16:59:52.526 NotebookApp]
To access the notebook, open this file in a browser:
file:///home/siavash/.local/share/jupyter/runtime/nbserver-5326-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=192817dbf13703bc25bbd1f348df5e9c1c7c9275d579aef3
(telegram-desktop:5339): lib_base-WARNING **: 16:59:53.204: Unfortunately, GTK integration conflicts with qgtk2 platformtheme and style. Therefore, QT_QPA_PLATFORMTHEME and QT_STYLE_OVERRIDE will be unset.
lib_base-Message: 16:59:53.204: This can be ignored by setting DESKTOP_APP_I_KNOW_ABOUT_GTK_INCOMPATIBILITY environment variable to any value, however, if qgtk2 theme or style is used, this will lead to a crash.
lib_base-Message: 16:59:53.204: GTK integration can be disabled by setting DESKTOP_APP_DISABLE_GTK_INTEGRATION to any value. Keep in mind that this will lead to some features being unavailable.
Gtk-Message: 16:59:53.412: Failed to load module "canberra-gtk-module"
Gtk-Message: 16:59:53.413: Failed to load module "canberra-gtk-module"
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
Ich habe mir auch angesehenDasähnliche Frage, aber sie beantwortet meine nicht.
Antwort1
Ich habe das Problem gefunden: Nach der Installation von Telegram wird Telegram seltsamerweise zur Standardanwendung zum Öffnen von HTML-Dateien. Deshalb jupyter-notebook
versucht es nach dem Ausführen im Terminal, den Link mit Telegram zu öffnen.
Um das Problem zu lösen, suchen Sie einfach eine beliebige HTML-Datei. Klicken Sie mit der rechten Maustaste darauf. Gehen Sie zu Properties
. Wählen Sie in Open With
der Registerkarte Ihren Browser aus und klicken Sie auf Set as default
.
Das Problem ist gelöst. Das nächste Mal wird Telegram nicht geöffnet. Stattdessen läuft Jupyter-Notebook in Ihrem Browser.
Antwort2
Wie bemerkt, sollten Sie Jupyter Notebook über einenanderer Port.
Ich konnte diesen Fehler nicht reproduzieren und habe auch keine Möglichkeit gefunden, Telegram-Desktop zur Verwendung eines anderen Ports zu zwingen, aber Sie können Jupyter Notebook so konfigurieren, dass ein anderer Port als verwendet wird 8888
.
Überprüfen Sie zunächst, ob die Datei /home/USERNAME/.jupyter/jupyter_notebook_config.py
vorhanden ist. Wenn nicht, führen Sie aus jupyter notebook --generate-config
.
Öffnen Sie dann diese Datei, und heben Sie die Kommentierung der folgenden Zeile auf. Ändern Sie 8889
beispielsweise den Port in :
c.NotebookApp.port = 8888
^ Change this port to 8889
Speichern Sie die Datei und führen Sie Jupyter Notebook erneut aus. Von nun an sollte sich Telegram Desktop nicht mehr öffnen.