Recently, Jupyter started using Jupyter Lab’s fancier user interface in ordinary jupyter notebook notebooks. But I had a weird problem. My rendered markdown cells would automatically collapse and hide themselves!

a gif of a markdown cell disappearing after I pressed ctrl-enter to render it.

The little blue rectangle on the left would collapse itself automatically on all markdown cells in my Jupyter notebooks after I executed the cell with Ctrl-Enter.. I couldn’t see any of my markdown cells in my Jupyter Lab notebooks.

That was very inconvenient. I don’t know why this happened, but it happened consistently on just one of my laptops.

Here’s how I fixed it: by blowing away all my Jupyter configurations. I basically did a “factory reset” of my Jupyter profile.

mv ~/.jupyter ~/.jupyter-old
mv /usr/local/etc/jupyter /usr/local/etc/jupyter-old
mv /etc/jupyter /etc/jupyter-old
mv ~/Library/Jupyter ~/Library/Jupyter-old
mv /usr/local/share/jupyter /usr/local/share/jupyter-old
mv /usr/share/jupyter /usr/share/jupyter-old
mv ~/.jupyter ~/.jupyter-old
mv ~/.ipython ~/.ipython-old

You could also do the same for each of your virtualenvs, but since my problem persisted across virtualenvs, I think this is unnecessary.

mv ~/.virtualenvs/myvenvname/etc/jupyter ~/.virtualenvs/myvenvname/etc/jupyter-old
mv ~/.virtualenvs/myvenvname/share/jupyter ~/.virtualenvs/myvenvname/share/jupyter-old

If I had any fancy settings, extensions or configurations, those would have been lost.

But this fixed the issue.

It also uninstalled all of my extensions – even the default ones. I got the Terminal option back in Jupyter lab by uninstalling and reinstalling jupyter_server_terminals with pip uninstall jupyter_server_terminals and pip install jupyter_server_terminals. (Simply reinstalling it didn’t fix the problem, I had to uninstall first.)

If you have this same problem, I hope this helps you fix it.

If you know of a more targeted, precise way to solve the problem, please send me an email. (My email is on my contact page.)