0

I am interested in using VSCode's Jupyter notebook functionality and I am just trying to get to grips with it. I can start the kernel and run the notebook cells in VSCode.

After running particular cells it seems to crash with no warning and the code fails as the variables have been cleared. I have to reselect the kernel in the top right and start running the code again from the beginning until I get to the problem cells, and then the issue repeats itself.

I don't think it's anything to do with the Python code, it's some simple dataframe manipulation. I have tried the same notebook just running it in the browser and it works fine.I am running Jupyter through a venv with Python 3.7.6, MacOS Catalina (10.15.4), VSCode 1.45.1.

Something I noticed that might help indicate what is happening, is when it crashes I can run basic python statements in the notebook cells (without reselecting the kernel). But when I run my cell which tries to import tests from a .py file in the same folder or import data files using a relative path, it can't find them until I reselect the kernel. It seems like the cwd has changed? Can anyone assist with this?

jmarlow
  • 176
  • 2
  • 6
  • Did you execute the cell that imports or creates the `df_interactions` names before this? – Brett Cannon May 25 '20 at 20:38
  • yes, i have ran the previous code importing and creating the dfs. The kernel seems to crash wiping the variables, that is why I am no longer seeing df_interactions. Maybe the screenshot is misleading, i'll delete it. I think it maybe a bug with VSCodes Jupyter implementation. I I'll raise it there. Thanks – jmarlow May 29 '20 at 13:55

0 Answers0