Prefigure module not loading

15 views
Skip to first unread message

Jason Miller

unread,
Feb 10, 2026, 12:59:12 PM (5 days ago) Feb 10
to PreTeXt support
I'm diving into the deep end of the pretext pool, using it to write guided lecture notes for students in my real analysis course.  I'm now trying to include some simple diagrams that will be rendered by prefigure.  However, my installation of pretext isn't loading the module when I run 'pretext build' or 'pretext generate'.
My documents and their prefigure assets generate fine on another machine I work on, so I know it's the installation that's failing me.
I'm working on a Mac Studio with
    python version 3.12.3
    node version v25.4.0
    pretext version 2.4.1
I've tried 'Pipx install pretext' and 'Pipx install pretext[all]' with no luck.  The only error I'm getting is this:
error: Unable to generate some prefigure images:
error:  PTX ERROR: the "prefig" module has failed to load, and
error:   this is necessary for the task you have requested.  Perhaps
error:   you have not installed it?  Or perhaps you have forgotten to
error:   use a Python virtual environment you set up for this purpose?
Honestly, I'm not that comfortable with these virtual environments that I associate with Pipx (as opposed to pip).  Can anyone point me to some instructions that will help me get my install in full working order?  I'm the only one who works on this machine, so I can nuke anything that will help get prefigure to generate document assets.
Thanks in advance!

Jason

NOTE:  no AI was used in the composition of this message to you
==================================
Jason Miller, Ph.D.
Professor of Mathematics
California State University Channel Islands

email:  jason....@csuci.edu
web:  http://www.jasonemiller.org

---> SAY NO to generative AI <---

David Austin

unread,
Feb 10, 2026, 1:08:04 PM (5 days ago) Feb 10
to pretext...@googlegroups.com
It looks like you may not have prefig installed in your virtual environment so you could try "pip install prefig" or "pipx install prefig" and try again.  Full installation instructions, including some dependencies, are available here.  

David

--
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.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/64ce1eb4-6b4a-4320-88f3-92d1739b9aedn%40googlegroups.com.

Jason Miller

unread,
Feb 10, 2026, 1:20:19 PM (5 days ago) Feb 10
to pretext...@googlegroups.com
David,

Thanks for the quick response to my cry for help.

My machine won’t let me execute pip at the CLI.  So I tried to install it with homebrew; my machine then told me 

Warning: No available formula with the name "pip". Did you mean pipx, pie, pig, pit, pcp, pop, pup, pyp, php, sip, vip or zip?
pip is part of the python formula:
  brew install python

I do have Pipx (version 1.8.0) installed and can run it from the CLI.  When I run ‘Pipx install prefig’ from the CLI I get this

'prefig' already seems to be installed. Not modifying existing installation in
'/Users/jason.miller/.local/pipx/venvs/prefig'. Pass '--force' to force installation.

Here I see ‘venv’ when suggests to me that a ‘virtual environment’ is involved in the use of prefig, but I don’t know how to invoke it.

Then ‘which prefig’ gives

/Users/jason.miller/.local/bin/prefig

Which is where I’d expect it to be.

Your notes on installing prefig are helpful (I’ve referenced them a couple times before), but they don’t address using Pipx, so they’re not helping me troubleshoot this issue.

Thoughts?

Jason


NOTE:  no AI was used in the composition of this message to you
==================================
Jason Miller, Ph.D.
Professor of Mathematics
California State University Channel Islands


---> SAY NO to generative AI <---
You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/sOPxRbIq_6U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/CANXmVMCozNp48nt6LWGhCLUoYKis4TW3dvaM_2uCS0SRYCqGUQ%40mail.gmail.com.

David Austin

unread,
Feb 10, 2026, 1:57:19 PM (5 days ago) Feb 10
to pretext...@googlegroups.com
I'm not a mac user and not super familiar with pipx, but I wonder if you have activated your virtual environment?  If you can find out where it resides, you could say "source venv/bin/activate" (assuming you're in a location where the virtual environment is in a directory called 'venv') to get it going. 

Jason Miller

unread,
Feb 10, 2026, 3:31:55 PM (5 days ago) Feb 10
to pretext...@googlegroups.com
Still trying to troubleshoot my installation of pretext and prefigure.

In the meantime, is there a way to invoke prefigure at the CLI to generate the assets in a pretext project?  It looks like prefigure needs some XLM file to do this, but I don’t see one in my pretext project — does pretext trash it after a run?  Is there a flag I can use with pretext build to keep that XML file around after the run?


NOTE:  no AI was used in the composition of this message to you
==================================
Jason Miller, Ph.D.
Professor of Mathematics
California State University Channel Islands


---> SAY NO to generative AI <---

Oscar Levin

unread,
Feb 10, 2026, 4:16:24 PM (5 days ago) Feb 10
to pretext...@googlegroups.com
You seem to have a really old version of pretext (2.36.0 is the current version).  I would suggest getting rid of pretext, which might be installed in a duplicate place.  The goal should be that if you run `pretext --version` you only get a message that pretext was not found.  Then you can install with pipx using `pipx install pretext[all]`.  I think.

Some things you can try to remove pretext: `pip uninstall pretext`, `python3 -m pip uninstall pretext`, `pipx uninstall pretext`.  

Oh, and you can try `pip list` and `pipx list` to see if they think pretext is installed.  This might give you different results thank `python3 -m pip list`, which would indicate you have multiple version of python on your path which is causing the issues.

Reply all
Reply to author
Forward
0 new messages