Error building sageplot with CLI

31 views
Skip to first unread message

jsebastie...@gmail.com

unread,
Feb 17, 2023, 2:40:00 PM2/17/23
to PreTeXt support
I tried building a new section today and got an error when I tried to generate <sageplot>.

The error is there even when I try to build previous stuff that used to be ok.

Here is the output from the terminal.

PreTeXt project found in `/home/user/ALIR`.
Since no target was specified with the -t flag, we will generate assets for the first target in the manifest (web).
Generating all assets in default formats for the target "web".
Note: No webwork elements found.
Note: No latex-image elements found.
Note: No asymptote elements found.
Now generating sageplot images


converting Sage diagrams from /home/user/ALIR/source/main.ptx to HTML graphics for placement in /home/user/ALIR/generated-assets/sageplot
extracting Sage diagrams from /home/user/ALIR/source/main.ptx
XSL conversion of /home/user/ALIR/source/main.ptx by /home/user/.ptx/xsl/extract-sageplot.xsl
comprehensive messages, warnings, and errors:
successful application of /home/user/.ptx/xsl/extract-sageplot.xsl
error: name 'ow' is not defined
##################
error: Failed to generate some sageplot elements.  Check your source and partial output to diagnose the issue.
warning: Continuing...
Now generating preview images for interactives


using playwright package to create previews for interactives from /home/user/ALIR/source/main.ptx for placement in /home/user/ALIR/generated-assets/preview
XSL conversion of /home/user/ALIR/source/main.ptx by /home/user/.ptx/xsl/extract-interactive.xsl
comprehensive messages, warnings, and errors:
successful application of /home/user/.ptx/xsl/extract-interactive.xsl
discovering source file's directory name: /home/user/ALIR/source
verifying and expanding input directory: /home/user/ALIR/source/../generated-assets
input directory expanded to absolute path: /home/user/ALIR/generated-assets
verifying and expanding input directory: /home/user/ALIR/source/../assets
input directory expanded to absolute path: /home/user/ALIR/assets
Opening subprocess http.server with port=8888
automatic screenshot of interactive with identifier "geog-simplexe1" on page http://localhost:8888/geog-simplexe1.html to file geog-simplexe1-preview.png
Closing http.server subprocess
Note: No video@youtube elements found.
Note: No program elements using codelens found.
Note: No elements needing datafile conversion found
Now generating QR codes for videos and/or interactives


manufacturing QR codes from /home/user/ALIR/source/main.ptx for placement in /home/user/ALIR/generated-assets/qrcode
XSL conversion of /home/user/ALIR/source/main.ptx by /home/user/.ptx/xsl/extract-qrcode.xsl
comprehensive messages, warnings, and errors:
successful application of /home/user/.ptx/xsl/extract-qrcode.xsl
creating URL with content "https://alir-jsturcotte.profweb.ca/geog-simplexe1.html" as /home/user/ALIR/generated-assets/qrcode/geog-simplexe1.png...
QR code creation complete

----------------------------------------------------
While running pretext, the following errors occured:

error: name 'ow' is not defined
error: Failed to generate some sageplot elements.  Check your source and partial output to diagnose the issue.
----------------------------------------------------

jsebastie...@gmail.com

unread,
Feb 17, 2023, 2:41:50 PM2/17/23
to PreTeXt support
Forgot to mention, this is using the latest nightly build  1.4.1.dev20230217

Rob Beezer

unread,
Feb 17, 2023, 3:02:22 PM2/17/23
to pretext...@googlegroups.com
Some recent Python work added a lot of "owd" as variables ("original working
directory"). But that stab-in-the-dark isn't leading me to a typo "ow" in the
core Python.

(It might help to know which piece of the puzzle is saying "error: name 'ow' is
not defined".)

Rob
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-suppo...@googlegroups.com
> <mailto:pretext-suppo...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pretext-support/5e3f0eb8-ad3b-4665-be94-5ffcad55a834n%40googlegroups.com <https://groups.google.com/d/msgid/pretext-support/5e3f0eb8-ad3b-4665-be94-5ffcad55a834n%40googlegroups.com?utm_medium=email&utm_source=footer>.

jsebastie...@gmail.com

unread,
Feb 17, 2023, 3:12:20 PM2/17/23
to PreTeXt support
Need to go AFK for the weekend, but I can confirm that building with 1.4.0 is fine.

Steven Clontz

unread,
Feb 17, 2023, 3:15:25 PM2/17/23
to PreTeXt support
I can confirm this is a bug on CLI nightly pretext-1.4.1.dev20230217 but not in 1.4.0.

Steven Clontz

unread,
Feb 17, 2023, 3:16:59 PM2/17/23
to PreTeXt support
The bug first appears in pretext-1.4.1.dev20230208

Steven Clontz

unread,
Feb 17, 2023, 3:18:33 PM2/17/23
to PreTeXt support

Alex Jordan

unread,
Feb 17, 2023, 3:18:54 PM2/17/23
to pretext...@googlegroups.com
Line 414 of pretext.py has:
owd = ow.getcwd()

Seems suspicious.
> To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/c2ed548f-6337-4cd3-9ff2-6dbbba55f102n%40googlegroups.com.

Rob Beezer

unread,
Feb 17, 2023, 5:11:18 PM2/17/23
to pretext...@googlegroups.com
Fixed, and should be in CLI nightly. Thanks for the report! And thanks to
Steven and Alex for the catch and fix.

https://github.com/PreTeXtBook/pretext/pull/1934
Reply all
Reply to author
Forward
0 new messages