SageTex - Initializing plots directory fails in external drive. [closed]

asked 2023-06-30 20:03:36 +0200

Hello,

MacOS 13.4.1 - TexLive 2023 - SageMath version 10.0, Release Date: 2023-05-20 │ │ Using Python 3.11.1.

When I run

% !TEX TS-program = sage
\documentclass{article}
\usepackage{sagetex}
\begin{document}

\begin{sagesilent}
 G = plot(sin(x),-pi,pi)
\end{sagesilent}
This is

\sageplot{G}

my plot
\end{document}

I have 3 different results for these two cases:

a) Whether the sage-plots-for-Untitled.tex directory exists or not.

b) whether the location is an external device or not.

If the directory does not exist (running for the first time or has been deleted), the result is as expected for both cases, where the files are on the internal or external hard drive.

If the directory already exists, the result is as expected if the files are on the internal hard drive.

If the files are on an external drive and the directory exists, sagetex fails with:

Processing Sage code for Untitled.tex...
Code block (line 7) begin...end
Initializing plots directory

**** Error in Sage code on line 12 of Untitled.tex! Traceback follows.
Traceback (most recent call last):
  File "/Volumes/TOSHIBA4T/teste/Untitled.sagetex.sage.py", line 19, in <module>
    _st_.plot(_sage_const_0 , format='notprovided', _p_=G)
  File "/private/var/tmp/sage-10.0-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sagetex.py", line 225, in plot
    self.initplot()
  File "/private/var/tmp/sage-10.0-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sagetex.py", line 107, in initplot
    shutil.rmtree(self.plotdir)
  File "/private/var/tmp/sage-10.0-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/shutil.py", line 732, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/private/var/tmp/sage-10.0-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/shutil.py", line 683, in _rmtree_safe_fd
    onerror(os.unlink, fullname, sys.exc_info())
  File "/private/var/tmp/sage-10.0-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/shutil.py", line 681, in _rmtree_safe_fd
    os.unlink(entry.name, dir_fd=topfd)
FileNotFoundError: [Errno 2] No such file or directory: '._plot-0.pdf'

**** Running Sage on Untitled.sage failed! Fix Untitled.tex and try again.

Anyone else had these problem? Can you help me? Is this a VenturaOS Privacy & Security issue?

Thanks, Filipe

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by qgfreire
close date 2023-07-02 18:46:02.908055

Comments

How is mounted your external drive ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2023-06-30 23:49:17 +0200 )edit

I had already tried USB3, USB-C but always ext_FAT.

But now with your question I tried it on an APFS disk and sage compiled the example Untitled.sagetex.sage without any problems. Thanks! But now, what's going on?

qgfreire gravatar imageqgfreire ( 2023-07-01 09:29:03 +0200 )edit

But now, what's going on?

Dunno...

Mac OS, its mysteries and shenanigans are opaque to me : I don't use these trendy but overpriced gadgets.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2023-07-02 08:28:13 +0200 )edit

Thanks Filipe

qgfreire gravatar imageqgfreire ( 2023-07-02 18:45:39 +0200 )edit

Filipe, did you solve your problem? If so, can you post a solution here?

slelievre gravatar imageslelievre ( 2023-07-04 15:44:59 +0200 )edit