
Estou no Ubuntu 20.04.2 LTS.
Quando desejo abrir o Jupyter-Notebook no terminal, o aplicativo Telegram para desktop é aberto.
O Jupyter-Notebook é realmente aberto em segundo plano. Para que eu possa abrir o navegador e usá-lo.
Aqui está a saída:
(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)
Eu também olheiessepergunta semelhante, mas não responde à minha.
Responder1
Encontrei o problema: depois de instalar o Telegram, por incrível que pareça, ele torna o Telegram o aplicativo padrão para abrir arquivos HTML. Por isso após rodar jupyter-notebook
no terminal ele tenta abrir o link com telegrama.
Então, para resolver o problema, basta encontrar qualquer arquivo HTML. Clique com o botão direito nele. Vá para Properties
. Na Open With
aba selecione seu navegador e clique em Set as default
.
O problema está resolvido. Da próxima vez o telegrama não abrirá. Em vez disso, você terá o jupyter-notebook em execução no seu navegador.
Responder2
Como observado, você deve executar o notebook Jupyter por meio de umporta diferente.
Não consegui reproduzir esse bug e também não consegui encontrar uma maneira de forçar o telegram-desktop a usar uma porta diferente, mas você pode configurar o notebook Jupyter para usar uma porta diferente de 8888
.
Primeiro, verifique se o arquivo /home/USERNAME/.jupyter/jupyter_notebook_config.py
existe. Se não, execute jupyter notebook --generate-config
.
Em seguida, abra este arquivo e remova o comentário da seguinte linha, alterando a porta para 8889
, por exemplo:
c.NotebookApp.port = 8888
^ Change this port to 8889
Salve o arquivo e execute o Jupyter Notebook novamente. De agora em diante, a área de trabalho do Telegram não deverá abrir.