VIDYA RENUKA
VIDYA RENUKA

Reputation: 229

Jupyter notebook executions turn grey in Visual studio code

I am trying to execute python code in VS code enabling jupyter notebook execution.Repeatedly the execution screen turns gray which makes the output invisible with the headers.Code will be still executable.

Any suggestions to recover from this issue..Each time copy pasting to another notebook and rerunning is not helping to solve the issue.

enter image description here

Upvotes: 20

Views: 13554

Answers (6)

ranemak
ranemak

Reputation: 122

None of the above methods worked for me.

What I did is to delete the .ipynb_checkpoints and __pycache__ folders. These were both hidden folders for me. Removing them solved the problem.

Upvotes: 0

Disperser1019
Disperser1019

Reputation: 51

On my macbook pro m1, I simply used cleamymac's cleaner and it worked fine.

All I had to do was clear the cache.

Upvotes: 0

starball
starball

Reputation: 50284

This is probably a case of The background of main interface became grey. #155242, which is currently in the milestone for the November 2023 (1.85) release. Just sit tight and wait for the fix.

One user reports that they can work around the issue by exporting the Notebook to a .py file (using the Jupyter: Convert to Python Script command in the command palette) and then convert the .py file back to a .ipynb file (right click an empty part of the .py file and select "Export Current File as Jupyter Notebook").

One user reports that it only happens for them when the cell outputs are very large. Try clearing your cell outputs or clearing the outputs of cells whose outputs are very large.

Upvotes: 0

beapea
beapea

Reputation: 105

Clearing all outputs in the notebook via VS Code's "Clear All Outputs" button (see the image below), and making sure there are no long/heavy outputs did the trick for me.

Button in VS Code for clearing the outputs

Upvotes: 10

Allison Harris
Allison Harris

Reputation: 1

Removing Cache didn't work for me, i just needed to update jupyternotebooks. So in the terminal i put this: pip install --upgrade jupyter jupyterlab notebook

Then i restarted everything and now it doesn't give me the grey screen and shows outputs again

Upvotes: 0

Pygin
Pygin

Reputation: 1154

I also have the same issue with VScode and Jupyter notebook, in my case it only happens when the overall size of the notebook is large (more than 150 MB) which caused by keeping the output of the cells (in my case the high quality figures), this causes the notebook to crash and grey out all the outputs. The solution that I found so far is to clear the output, it won't crash again, there is also some solution suggested by the developers here, which suggests to remove the Code cash. I would suggest to break long notebooks to smaller notebooks, or clear the output.

Update

I frequently had this issue with my notebooks of any size. One of the solutions was to remove the code Cache on my Windows machine (for mac users you have to find the equivalent app data on your system and remove the Cache).

The easiest way to access the Cache folder is to open a run window and search the following line and delete the Cache as much as you can:

%APPDATA%\Code - Insiders\Code Cache

It helped me so far. Please let me know if it worked for you guys too or you found any other solutions.

Upvotes: 6

Related Questions