Can't get SageTex to work with TexStudio in Windows.
I installed sage through the WSL + Conda-Forge method. Copied sagetex.sty to the documents folder.
if I run the sage command on the sagetextry.sagetex.sage manually, everything works:
wsl /home/l3gi0n/miniforge3/envs/sage/bin/sage sagetextry.sagetex.sage
but when I add a user command in TexStudio, it doesn't:
I get the following error:
Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode "sagetextry".tex
Process exited normally
Process started: wsl /home/l3gi0n/miniforge3/envs/sage/bin/sage "sagetextry".sagetex.sage
Traceback (most recent call last): File "/home/l3gi0n/miniforge3/envs/sage/lib/python3.12/site-packages/sage/misc/temporary_file.py", line 404, in __exit__ os.rename(self.tempname, self.target) PermissionError: [Errno 13] Permission denied: '/mnt/c/Users/Amir/Desktop/latexdoc/tmp4cq71zr6' -> '/mnt/c/Users/Amir/Desktop/latexdoc/sagetextry.sagetex.sage.py' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/l3gi0n/miniforge3/envs/sage/bin/sage-preparse", line 302, in <module> do_preparse(f) File "/home/l3gi0n/miniforge3/envs/sage/bin/sage-preparse", line 151, in do_preparse with atomic_write(fname) as f: ^^^^^^^^^^^^^^^^^^^ File "/home/l3gi0n/miniforge3/envs/sage/lib/python3.12/site-packages/sage/misc/temporary_file.py", line 406, in __exit__ os.unlink(self.target) FileNotFoundError: [Errno 2] No such file or directory: '/mnt/c/Users/Amir/Desktop/latexdoc/sagetextry.sagetex.sage.py' Process exited with error(s)
Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode "sagetextry".tex
Process exited normally
if I save my .tex document in the Linux environment:
\\wsl.localhost\Ubuntu-24.04\home\l3gi0n\
the problem goes away.