ターミナルで Jupyter-Notebook を開くと、Telegram デスクトップが開きます。

ターミナルで Jupyter-Notebook を開くと、Telegram デスクトップが開きます。

私はUbuntu 20.04.2 LTSを使用しています。

ターミナルで Jupyter-Notebook を開こうとすると、Telegram デスクトップ アプリが開きます。

Jupyter-Notebook は実際にはバックグラウンドで開かれます。そのため、ブラウザを開いて使用することができます。

出力は次のとおりです。

(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)

私も見ましたこれ同様の質問ですが、私の質問への回答にはなりません。

答え1

問題が見つかりました: Telegram をインストールすると、不思議なことに HTML ファイルを開くためのデフォルトのアプリケーションが Telegram になります。そのため、jupyter-notebookターミナルで実行した後、Telegram でリンクを開こうとします。

したがって、問題を解決するには、任意の HTML ファイルを見つけます。それを右クリックします。 に移動しますProperties。タブでOpen Withブラウザを選択し、 をクリックしますSet as default

問題は解決しました。次回は Telegram は開きません。代わりに、ブラウザで jupyter-notebook が実行されます。

答え2

ご存知のとおり、jupyterノートブックを別のポート

このバグを再現することはできませんでしたし、telegram-desktop に別のポートを強制的に使用させる方法も見つけられませんでしたが、jupyter notebook が 以外のポートを使用するように設定することはできます8888

まず、ファイルが/home/USERNAME/.jupyter/jupyter_notebook_config.py存在するかどうかを確認します。存在しない場合は、 を実行しますjupyter notebook --generate-config

次に、このファイルを開き、次の行のコメントを解除して、ポートを8889次のように変更します。

c.NotebookApp.port = 8888
                      ^ Change this port to 8889

ファイルを保存し、jupyter ノートブックを再度実行します。これで、Telegram デスクトップは開かなくなります。

関連情報