Setting the path for the CLI

41 views
Skip to first unread message

Thomas Judson

unread,
Aug 29, 2022, 12:19:32 PM8/29/22
to pretext...@googlegroups.com
I execute the command

D25WC068J1GP:~ judsontw$ python3 -m pretext --version
1.0.2

I can create a new project this way too.

I need to set the path so I can just type

pretext --version

I thought that I had installed the CLI in 

/Users/judsontw/Documents/pretext/pretext

but pretext —version doesn’t find the command.

What am I missing?

Tom

GVSU Open Education Resources

unread,
Aug 29, 2022, 12:27:37 PM8/29/22
to PreTeXt support
Hi!

I actually had this issue a few weeks ago (I use a Mac). I can't guarantee that this will work for you or all cases, but here is what I did to troubleshoot:

  1. Uninstall `pretext` and reinstall it
  2. Uninstall Python and reinstall it (turns out I had more than one version of Python installed since my system version of Python and my downloaded version of Python were different)
  3. Uninstall/update Git
  4. Update my text editor
I also messed with some of my PATH variables (which I don't have much experience with).

Something ended up magically working and things are fixed for me now. I hope that something from here works for you!

David Farmer

unread,
Aug 29, 2022, 12:35:30 PM8/29/22
to PreTeXt support

Probably it is the $PATH variable that made the difference and not
the uninstall and reinstall.

On Mon, 29 Aug 2022, GVSU Open Education Resources wrote:

> Hi!
> I actually had this issue a few weeks ago (I use a Mac). I can't guarantee that this will work for you or all cases, but here
> is what I did to troubleshoot:
>
> 1. Uninstall `pretext` and reinstall it
> 2. Uninstall Python and reinstall it (turns out I had more than one version of Python installed since my system version of
> Python and my downloaded version of Python were different)
> 3. Uninstall/update Git
> 4. Update my text editor
> I also messed with some of my PATH variables (which I don't have much experience with).
>
> Something ended up magically working and things are fixed for me now. I hope that something from here works for you!
>
> On Monday, August 29, 2022 at 12:19:32 PM UTC-4 twju...@gmail.com wrote:
> I execute the command
> D25WC068J1GP:~ judsontw$ python3 -m pretext --version
> 1.0.2
>
> I can create a new project this way too.
>
> I need to set the path so I can just type
>
> pretext --version
>
> I thought that I had installed the CLI in 
>
> /Users/judsontw/Documents/pretext/pretext
>
> but pretext —version doesn’t find the command.
>
> What am I missing?
>
> Tom
>
> --
> 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/020360ba-88ba-4b0e-a1aa-e1fd71cf1a81n%40googlegroups.com.
>
>

Thomas Judson

unread,
Aug 29, 2022, 1:37:59 PM8/29/22
to pretext...@googlegroups.com
I also think that it is the path variable, but I am unsure of the location of pretext.  If I go to where I think that it should be, then I get an error.

Mitch Keller

unread,
Aug 29, 2022, 1:40:37 PM8/29/22
to pretext...@googlegroups.com
pip puts things in places you might not expect, and generally pip should be putting it somewhere that’s in your path. You don’t choose where the CLI gets installed; pip does.

For me on macOS with Homebrew python, my pretext is /opt/homebrew/bin/pretext
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/83AF5E84-ABD4-451A-AFA6-4BED1C32C3A5%40gmail.com.

--
Mitch Keller
mi...@rellek.net

http://www.rellek.net/

Thomas Judson

unread,
Aug 29, 2022, 2:57:54 PM8/29/22
to pretext...@googlegroups.com
It looks to be in 

/Users/judsontw/Documents/pretext/pretext

But I get

D25WC068J1GP:pretext judsontw$ pretext --version
-bash: pretext: command not found

??? I am at a loss.

Tech support has their administrative spy ware install.  Could this be getting in the way?


David Farmer

unread,
Aug 29, 2022, 3:01:38 PM8/29/22
to pretext...@googlegroups.com

You might have pretext in /Users/judsontw/Documents/pretext,
but that does not mean it is the pretext you are looking for.

What do you have from

echo $PATH
> https://groups.google.com/d/msgid/pretext-support/DC7B9973-EB5A-48F2-8592-C1771946EA1C%40gmail.com.
>
>

Mitch Keller

unread,
Aug 29, 2022, 3:03:48 PM8/29/22
to pretext...@googlegroups.com
I think you’re confusing Rob’s pretext/pretext script with the CLI. What does

which python3

report?
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/DC7B9973-EB5A-48F2-8592-C1771946EA1C%40gmail.com.

Thomas Judson

unread,
Aug 29, 2022, 3:10:18 PM8/29/22
to pretext...@googlegroups.com

Thomas Judson

unread,
Aug 29, 2022, 3:11:14 PM8/29/22
to pretext...@googlegroups.com
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin


Thomas Judson

unread,
Aug 29, 2022, 3:22:29 PM8/29/22
to pretext...@googlegroups.com
Everything works on my MacBook Pro as expected, but I had to reinstall the operating system on my office iMac.  I am still trying to reconstruct everything on the iMac.  Apple is currently preparing the case on my MacBook Pro.

Tom

Thomas Judson

unread,
Sep 8, 2022, 4:08:10 PM9/8/22
to PreTeXt support
Solved the problem with the help of Oscar and Mitch.  I made a .bash_profile in my root directory with the line

export PATH=$PATH:/Users/judsontw/Library/Python/3.8/bin


Rob Beezer

unread,
Sep 9, 2022, 12:07:54 AM9/9/22
to pretext...@googlegroups.com
Do we think this incantation should be added to an appendix? In other words, was this Tom-specific, or will others hit the same roadblock?
>> https://groups.google.com/d/msgid/pretext-support/alpine.LRH.2.21.2208291234470.8758%40li375-150.members.linode.com
>> .
>>
>>
>>
>

Mitch Keller

unread,
Sep 9, 2022, 9:43:32 AM9/9/22
to pretext...@googlegroups.com
I wouldn’t add it to an appendix unless it comes up again. Tom somehow got Python 3 from Apple, which is not our recommended way to get Python 3 on a Mac. If folks use Home-brew, this isn’t an issue.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/MTAwMDAzMS5iZWV6ZXI.1662696473%40quikprotect.

Rob Beezer

unread,
Sep 9, 2022, 11:43:32 AM9/9/22
to pretext...@googlegroups.com
Got it! Thanks.
Reply all
Reply to author
Forward
0 new messages