I have had trouble locating any specific help with what appears to be an installation problem.
I installed Jupyter Lab using the recommended method of pip install jupyter-lab
from jupyter.org.
System Details:
- OS is Mint 20.3 Cinnamon
- Browser is Chrome (v 103.0.5060.114)
- Python is 3.8.10 (64bit)
After having issues when trying to open older notebook files I discovered I can’t even create a new file. All attempts respond with the following error:
Unexpected error while saving file: Downloads/Untitled.ipynb [Errno 2] No such file or directory: '/home/user/Notebooks/.~Untitled.ipynb' -> '/home/user/Notebooks/Untitled.ipynb'
A file of this name was created but opening the file in a text editor shows it to be empty. Nothing, not even initialization information, was written to it. I get the same error when I open an existing file from the same (or any other) directory.
I have tried the usual uninstalling and reinstalling as well as rebooting and cleaning out old preferences. Does anyone have an idea as to what may be wrong?
Additional Detail from running jupyter lab
with the debugger after tapping the File → New → Notebook:
[I 2022-07-06 10:30:34.667 LabApp] Build is up to date
[I 2022-07-06 10:30:58.786 ServerApp] Creating new notebook in /Notebooks
[E 2022-07-06 10:30:58.803 ServerApp] Error while saving file: Notebooks/Untitled.ipynb [Errno 2] No such file or directory: '/home/user/Notebooks/.~Untitled.ipynb' -> '/home/user/Notebooks/Untitled.ipynb'
Traceback (most recent call last):
File "/home/user/.local/lib/python3.8/site-packages/jupyter_server/services/contents/fileio.py", line 112, in atomic_writing
yield fileobj
File "/home/user/.local/lib/python3.8/site-packages/jupyter_server/services/contents/fileio.py", line 210, in atomic_writing
yield f
File "/home/user/.local/lib/python3.8/site-packages/jupyter_server/services/contents/fileio.py", line 294, in _save_notebook
nbformat.write(
File "/home/user/.local/lib/python3.8/site-packages/nbformat/__init__.py", line 164, in write
s = writes(nb, version, **kwargs)
File "/home/user/.local/lib/python3.8/site-packages/nbformat/__init__.py", line 110, in writes
return versions[version].writes_json(nb, **kwargs)
File "/home/user/.local/lib/python3.8/site-packages/nbformat/v4/nbjson.py", line 56, in writes
return json.dumps(nb, **kwargs)
File "/usr/lib/python3.8/json/__init__.py", line 234, in dumps
return cls(
TypeError: __init__() got an unexpected keyword argument 'capture_validation_error'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/.local/lib/python3.8/site-packages/jupyter_server/services/contents/filemanager.py", line 435, in save
self._save_notebook(os_path, nb, capture_validation_error=validation_error)
File "/home/user/.local/lib/python3.8/site-packages/jupyter_server/services/contents/fileio.py", line 294, in _save_notebook
nbformat.write(
File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "/home/user/.local/lib/python3.8/site-packages/jupyter_server/services/contents/fileio.py", line 210, in atomic_writing
yield f
File "/usr/lib/python3.8/contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "/home/user/.local/lib/python3.8/site-packages/jupyter_server/services/contents/fileio.py", line 116, in atomic_writing
replace_file(tmp_path, path)
File "/home/user/.local/lib/python3.8/site-packages/jupyter_server/services/contents/fileio.py", line 24, in replace_file
os.replace(src, dst)
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/Notebooks/.~Untitled.ipynb' -> '/home/user/Notebooks/Untitled.ipynb'
[W 2022-07-06 10:30:58.806 ServerApp] 500 POST /api/contents/Notebooks?1657117858764 (127.0.0.1): Unexpected error while saving file: Notebooks/Untitled.ipynb [Errno 2] No such file or directory: '/home/user/Notebooks/.~Untitled.ipynb' -> '/home/user/Notebooks/Untitled.ipynb'
[W 2022-07-06 10:30:58.807 ServerApp] Unexpected error while saving file: Notebooks/Untitled.ipynb [Errno 2] No such file or directory: '/home/user/Notebooks/.~Untitled.ipynb' -> '/home/user/Notebooks/Untitled.ipynb'
[E 2022-07-06 10:30:58.809 ServerApp] {
"Host": "localhost:8888",
"Accept": "*/*",
"Referer": "http://localhost:8888/lab/tree/Notebooks",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
}
[E 2022-07-06 10:30:58.809 ServerApp] 500 POST /api/contents/Notebooks?1657117858764 (127.0.0.1) 25.68ms referer=http://localhost:8888/lab/tree/Notebooks