Can't get SageTex to work with TexStudio in Windows.

asked 2025-04-26 00:02:19 +0200

l3gi0n gravatar image

updated 2025-04-28 07:30:21 +0200

FrédéricC gravatar image

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:

image description image description

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

edit retag flag offensive close merge delete

Comments

1

if I save my .tex document in the Linux environment:

\\wsl.localhost\Ubuntu-24.04\home\l3gi0n\

the problem goes away.

l3gi0n gravatar imagel3gi0n ( 2025-04-27 16:22:47 +0200 )edit