I got this error message:
UsageError: Line magic function %%writefile
not found.
Please check my code and service log from jupyter notebook. Please help me.\
Version : Python 3.11.3 Environemt : Code-Server Docker Container (Ubuntu 20.04 Jammy).
Thanks.
I already tried to restart the kernel, re-run Jupyter Notebook, and re-install Ipykernel. But all of that doesn't make any difference. Still, I'm not able to try to modify my text file.
The Cell magic fuction
i.e %%
must be on the first line where you have the comment. You don't have it on top so it was parsed as Line magic function %%writefile not found.
i.e. %
.
Cell magic fuction
on first line.
%%writefile file.txt
hello
or
Cell magic fuction
on second line where the first line is empty.
%%writefile file.txt
hello
comments or any other line on top
# some thing
%%writefile file.txt
hello
removing comment works fine
%%writefile ../notes/perform-10.txt
test