Error loading Jupyter Notebook from a child directory

Viewed 97

Since I have updated to macOS Big Sur (I have managed to fix all of the Python issues that Big Sur created on my computer. This article is helpful for that), I've been unable to open the Jupyter Notebooks in any of the child directories of where I start my Jupyter Notebook.

I can however open notebooks in the same directory as where I had started my Jupyter Notebook instance.

Here is a screenshot of the error message:

Error pop-up loading notebook

Here also is the error message I get in the terminal when trying to open a new notebook in a child directory:

[W 20:18:51.458 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20210723201825 (::1) 2.560000ms referer=http://localhost:8888/notebooks/0001_analysis/Untitled2.ipynb?kernel_name=python3

I use pyenv and poetry to manage my python environment and packages. I have the local version of python set to Python 3.8.2.

Here are my poetry dependencies in my pyproject.toml:

[tool.poetry.dependencies]
python = "^3.8

[tool.poetry.dev-dependencies]
pandas = "^1.3.0"
scikit-learn = "^0.24.2"
jupyter = "^1.0.0"
seaborn = "^0.11.1"
ipykernel = "^6.0.1"

Would be great to fix this, as it is inconvenient having to create new notebook instances when I need to open notebooks in different child directories of my project.

1 Answers

This may be system integrity protection, though I've seen it in Catalina before, did you leapfrog a version ?

If you are starting Jupyter from the terminal, try the following:

Open a new terminal, , type cd (with a space) and drag and drop the folder you wish to start jupyter in to the terminal. You need to drag and drop, this will flag the folder as being "ok to be accessed from application launched from the terminal" typing the path by hand won't help. Press enter, and then try to start jupyter from there.

If you have any error message in the terminal they should be helpful, try to also open the .ipynb files with a text editor to make sure they are not corrupted, and/or share them with somebody else to see if they can open it.

Related