PreTeXt-cli not working on windows

52 views
Skip to first unread message

Elise Desgreniers

unread,
Aug 10, 2022, 9:27:12 PM8/10/22
to PreTeXt support
Hi everyone,

I've been using PreTeXt for 2 years, compiling with xsltproc on Windows (and using pretext-script for images and video previews). It worked and is still working fine.

For this semester, I wanted to simplify all the process by using PreTeXt-cli. I followed the instructions in the guide and it is not working. I watched Sean's video (https://pretextbook.org/doc/guide/html/windows-cli.html) and I do not get the same messages (see below). I searched for a thread in the forum (also tried Google), and did not find anything.

Here's what I get when I enter the command pretext new book:
   $ pretext new book
   Generating new PreTeXt project in `book`.

That's all. :(
Not at all like Sean's video.
And in the new folder named «book», there is only one folder (source), and 3 files, including publisher.ptx.

In the new folder, when i use the command pretext build html, here's what I get (again, not like Sean's video):
$ pretext build html
   PTX-CLI: XSL conversion of      C:\Users\elise.desgreniers\mathbook\examples\kb1\ptx\book\source\main.ptx by c:\users\elise.desgreniers\appdata\local\programs\python\python38\lib\site-   packages\pretext\static\xsl\pretext-html.xsl
   PTX-CLI: Loading the transform
   PTX-CLI: Transforming the source

Is it possible that my «old» installation (git, python, windows path...) is interfering with the pretextbook pip install? I am reluctant to uninstall it all with school starting in 1 week and my need to work on my notes...

Also, I did not install the pdf2svp like Sean did (I think I installed it 2 years ago for converting latex images to svg, but it is not in my pip list). Could this be the problem?

Thanks for your help,

Elise

***

If it can help, here are the steps I did and some informations on versions I have.

I installed pretextbook:
   $ pip install pretextbook
   Collecting pretextbook
     Using cached pretextbook-0.2-py3-none-any.whl (667 kB)
   [...]
   Successfully installed pretextbook-0.2

I don't get why the version installed is 0.2 (in Sean's video, it's 0.6.3):
   $ pretext --version
   0.2

I tried pip install pretextbook --upgrade, and it's still 0.2.

Python is already installed (to generate video previews with the pretext script). 
   $ python --version
   Python 3.8.4rc1

Git bash is also installed:
   $ git --version
   git version 2.26.2.windows.1 

Sean Fitzpatrick

unread,
Aug 10, 2022, 9:54:50 PM8/10/22
to pretext...@googlegroups.com
You should be getting something like 0.8.1 for the version.


Maybe you need to upgrade pip?

Try 'pip install --upgrade pip' and then
'pip install --upgrade pretextbook'

But if you have the PreTeXt from GitHub in your Windows path you would also want to get rid of that.


--
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 on the web visit https://groups.google.com/d/msgid/pretext-support/26beb504-7fec-4568-b9fe-fc56e3531a91n%40googlegroups.com.

Elise Desgreniers

unread,
Aug 11, 2022, 8:20:33 AM8/11/22
to PreTeXt support
Thanks for your answer. But it didn't work.  :(

Pip is upgraded (it was yesterday also):
     $ pip --version
     pip 22.2.2 from c:\users\elise.desgreniers\appdata\local\programs\python\python38\lib\site-packages\pip (python 3.8)

I tried «pip install --upgrade pretextbook»: no change. Still version 0.2.

I don't think the PreTeXt from GitHub is in my windows path (see attached file for list of variables in my system).

I tried uninstalling every element in my pip list (that came from pretextbook pip installation), and reinstalling pretextbook. Still version 0.2.
     $ pip install pretextbook
     Collecting pretextbook
       Using cached pretextbook-0.2-py3-none-any.whl (667 kB)

The installation log seems to tell it is using a cached file for the installation. Am I wrong in assuming that? If so, what should I do?

Any other idea?

Again, thanks for the help!
path.png

Oscar Levin

unread,
Aug 11, 2022, 8:27:20 AM8/11/22
to PreTeXt support
The issue here is that we used to require python 3.8.4 back when 0.2 came out, but now need python 3.8.5.  If you upgrade your python install, that should solve the problem.  If you don't want to do that globally, you could use pyenv to get a newer version just for this purpose.  

This gotcha will go away with the upcoming 1.0 release, since you will pip install pretext, so pip will not let you get away with the older version of pretextbook.

Elise Desgreniers

unread,
Aug 11, 2022, 8:30:43 AM8/11/22
to PreTeXt support
Thanks for that info! 

I am going to update python immediatly then. Should I get the latest version (3.10.6) or the python 3.8.5 version you suggest in your post?

Elise

Oscar Levin

unread,
Aug 11, 2022, 8:42:49 AM8/11/22
to pretext...@googlegroups.com
Either should work just fine.  I would go with the most recent stable release as long as you don't know of any other reason not to upgrade.

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/EEYZvnz008Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/623b9c74-a327-4bce-be22-6b4326c09973n%40googlegroups.com.

Elise Desgreniers

unread,
Aug 11, 2022, 10:10:17 AM8/11/22
to PreTeXt support
THANK YOU!

Upgrading my python version solved the problem.

I don't remember reading the python minimal version in the documentation. If it's not written anywhere, it could be nice to add it. If it is in the documentation, then I'm sorry I missed it. Hopefully, this thread will help somebody in the future.  ;)

Elise

Reply all
Reply to author
Forward
0 new messages