Last updated: Apr 13, 2024
Reading time·3 min
The Jupyter Notebook error "'_xsrf' argument missing from post" occurs when your currently opened Jupyter Notebook window glitches.
The first thing you should try is to open another existing notebook on the same kernel.
.ipynb
file).You can also select File and then New Notebook and create a new notebook if you don't already have another existing notebook.
Make sure to create the new notebook on the same kernel.
Go back to the notebook that was showing the "'_xsrf' argument missing from post" error and save it.
If you've already closed the browser window that was showing the xsrf
error,
focus your terminal and scroll up until you see the http://localhost
link and
click on it.
You can also issue the jupyter notebook list
command in another terminal tab
to get the link.
jupyter notebook list
/tree
endpoint and refresh your browserIf the error persists, try to visit the /tree
endpoint, e.g.
http://localhost:8888/tree
and refresh your browser.
Once you visit the /tree
endpoint in your browser, refresh the page.
Then, click on New and reopen the kernel.
http://localhost:8888/?token=XYZ
page from
your terminal (or browser address bar).You can also issue the jupyter notebook list
command in another terminal tab
to get the link.
jupyter notebook list
_xsrf
error and try to
save your notebook.You can also try to paste the link into a new browser window and then switch back to the original window.
xsrf
checks disabledAnother thing you can try is to launch Jupyter Lab with the XSRF
checks
disabled.
Run the following command from your terminal.
jupyter lab --ServerApp.disable_check_xsrf=True
Another thing you can try is to download the notebook.
.ipynb
file.If none of the suggestions helped:
Click on Kernel in the top menu.
Click on Interrupt.
You can learn more about the related topics by checking out the following tutorials: