¡Al abrir Jupyter-Notebook en la terminal se abre Telegram Desktop!

¡Al abrir Jupyter-Notebook en la terminal se abre Telegram Desktop!

Estoy en Ubuntu 20.04.2 LTS.

Cuando quiero abrir Jupyter-Notebook en la terminal, se abre la aplicación de escritorio de Telegram.

En realidad, Jupyter-Notebook se abre en segundo plano. Entonces puedo abrir el navegador y usarlo.

Aquí está el resultado:

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

yo también miréestePregunta similar, pero no responde a la mía.

Respuesta1

Encontré el problema: después de instalar Telegram, curiosamente hace que Telegram sea la aplicación predeterminada para abrir archivos HTML. Por eso, después de ejecutarlo jupyter-notebooken la terminal, intenta abrir el enlace con Telegram.

Entonces, para resolver el problema, simplemente busque cualquier archivo HTML. Haga clic derecho sobre él. Ir a Properties. En Open Withla pestaña seleccione su navegador y haga clic en Set as default.

El problema esta resuelto. La próxima vez Telegram no se abrirá. En su lugar, tendrás jupyter-notebook ejecutándose en tu navegador.

Respuesta2

Como notó, debe ejecutar jupyter notebook a través de unpuerto diferente.

No pude reproducir este error y tampoco pude encontrar una manera de forzar a Telegram-Desktop a usar un puerto diferente, pero puedes configurar Jupyter Notebook para usar un puerto que no sea 8888.

Primero, verifique si el archivo /home/USERNAME/.jupyter/jupyter_notebook_config.pyexiste. Si no, corre jupyter notebook --generate-config.

Luego, abra este archivo y descomente la siguiente línea, cambiando el puerto a 8889, por ejemplo:

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

Guarde el archivo y ejecute jupyter notebook nuevamente. A partir de ahora, el escritorio de Telegram no debería abrirse.

información relacionada