Rename failed - 'os_path' is not defined

After installing notebook (version 6.4.12) via pip on Windows 10, I ran the application using

python -m notebook

as per here, entered some basic content and code (all of which ran fine) and then attempted to rename my notebook. This failed, with the following error text:

Rename Failed
An error occurred while renaming "Untitled.ipynb" to "Introduction.ipynb".
Traceback (most recent call last): File "C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tornado\web.py", line 1704, in _execute result = await result File "C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\tornado\gen.py", line 234, in wrapper yielded = ctx_run(next, result) File "C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\notebook\services\contents\handlers.py", line 135, in patch model = yield maybe_future(cm.update(model, path)) File "C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\notebook\services\contents\manager.py", line 296, in update self.rename(path, new_path) File "C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\notebook\services\contents\manager.py", line 284, in rename self.rename_file(old_path, new_path) File "C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\notebook\services\contents\filemanager.py", line 579, in rename_file raise web.HTTPError(400, f'Cannot rename file or directory {os_path!r}') NameError: name 'os_path' is not defined

What should I do in order to successfully rename my notebooks?

2 Likes

Looks like a bug in the error handling, os_path isn’t defined:

1 Like

I am also facing same issue . Commenting for subscription .
I have raised the issue on git too. check it out :issue_6458

1 Like