Automatically started kernels in jupyterlab break matplotlib
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 30/100
Piste de recherche
Commencez par reproduire le problème avec l’environnement conda indiqué, jupyter lab et l’exemple %matplotlib widget. Comparez l’état du kernel après avoir rouvert le notebook avec l’état après avoir utilisé Kernel > Shut Down Kernel et Kernel > Restart Kernel ; la tâche est terminée lorsque le notebook rouvert affiche le graphique sans sortie noire ni avertissements No such comm.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
When a jupyterlab server is shut down, it remembers which files were open the next time it starts. When the jupyterlab server is restarted, it opens those files and starts a kernel for each one. These kernels are cursed. If %matplotlib widget is used in any of these open files, matplotlib will show a black image instead of the expected plot. Errors like [IPKernelApp] WARNING | No such comm: fcef8c0be3a345e493e771adbbb0df16 appear in the server's standard out. Restarting the kernel does not help. The kernel must be shut down and then restarted. Only then will the notebook display plots correctly.
How to reproduce
- Create a new conda environment with jupyterlab and matplotlib installed and start the server.
conda create -n temp -c conda-forge jupyterlab==1.0.9 matplotlib==3.1.1 ipympl==0.3.3
conda activate temp
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter lab
-
Create a new notebook in JupyterLab and leave it open.
-
Shutdown the server and restart it. Note that the new file has a running kernel.
-
Put some plotting code using
%matplotlib widgetin the notebook and run it. A black box will appear instead of a plot. Error messages will stream in the console.
%matplotlib widget
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 1, 500)
y = np.sin(4 * np.pi * x) * np.exp(-5 * x)
fig, ax = plt.subplots()
ax.fill(x, y, zorder=10)
ax.grid(True, zorder=5)
plt.show()
- Navigate to Kernel > Shut Down Kernel and then Kernel > Restart Kernel. Run the notebook again and the plots will appear.
- Langage dominant
- Jupyter Notebook
- Étoiles
- 1.7k
- Forks
- 236
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de matplotlib/ipympl
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
matplotlib/ipympl#623 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
matplotlib/ipympl#622 · 13 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 42/100
matplotlib/ipympl#612 ·
-
DeprecationWarning: Passing unrecognized arguments to super(Toolbar).__init__().Peut-être pris @pradeep14012004 l’a pris il y a 5 jours. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
matplotlib/ipympl#611 · 4 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 42/100
matplotlib/ipympl#609 · 7 commentaires ·
Toutes les issues de matplotlib/ipympl
Issues similaires
-
[Bug][Python SDK] RecallMemory drops RFC-3339 created_at write-time timestamp returned by relayerOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
MystenLabs/MemWal#1160 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Idle compaction monitors LIST the replica every tick when the newest destination file spans more than one TXIDPeut-être pris @pishuv l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
benbjohnson/litestream#1563 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
Fix Math.ceilDiv wrong result for exact positive divisionsPeut-être pris @pamod-madubashana l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
scala-native/scala-native#5094 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour