Closed siwelwerd closed 9 months ago
I definitely need to improve the error handling on this. I suspect the issue is that pretext is trying to validate your project.ptx
file, and that since v2.0 of the CLI was released, that is throwing an error that wasn't present before.
If you post the content of your project.ptx
, I can help you fix that. You might also try starting a new project (CTRL+SHIFT+P -> "PreTeXt: New Project") and see if the issue persist with the new project.
Thanks @oscarlevin. Happy to report that with the suggestion that Pretext 2.0 changes may be causing this, I figured it out. For reasons I don't understand (because python environment handling is a mess), I have multiple versions of PreTeXt installed in different locations, and the PATH variable I get when I open a shell in the terminal (from the OS) is different than the PATH variable I get when I open a shell in the terminal from VS code:
Opening a terminal from the OS:
(base) drew@Drews-MBP ~ % which pretext
/opt/homebrew/Caskroom/miniconda/base/bin/pretext
(base) drew@Drews-MBP ~ % echo $PATH
/opt/homebrew/Caskroom/miniconda/base/bin:/opt/homebrew/Caskroom/miniconda/base/condabin:/Users/drew/Library/Python/3.8/bin:/Library/TeX/texbin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
(base) drew@Drews-MBP ~ %
Using the terminal within VScode:
(base) drew@Drews-MBP calculus % which pretext
/Users/drew/Library/Python/3.8/bin/pretext
(base) drew@Drews-MBP calculus % echo $PATH
/Users/drew/Library/Python/3.8/bin:/Library/TeX/texbin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/homebrew/Caskroom/miniconda/base/bin:/opt/homebrew/Caskroom/miniconda/base/condabin:/Users/drew/Library/Python/3.8/bin:/opt/homebrew/bin:/opt/homebrew/sbin
(base) drew@Drews-MBP calculus %
Once I updated the /opt/homebrew/Caskroom/miniconda/base/bin/pretext
to 2.0, now it works. But I was mislead thinking all my PreTeXt in VSCode was 2.0, because the terminal there was calling the /Users/drew/Library/Python/3.8/bin/pretext
, while the error message above indicates the extension was calling the other one.
So all that to say: the version of PreTeXt used by the PreTeXt-tools extension may not be the same as the version used by the VS code terminal, which is likely to cause further difficulties in tracking down bugs.
I cannot get the extension to load on my desktop version of VSCode (I have been enjoying using it in Codespaces), running OSX version 13.5 (22G74).
Steps taken: I completely uninstalled VSCode (following steps here: https://stackoverflow.com/a/47561948), then downloaded and installed VSCode version 1.82.2. Then I installed the pretext-tools extension. When I click the 'PreTeXt' button on the bottom toolbar, I get an error pop up saying
command 'pretext-tools.selectPretextCommand' not found
.I pulled up the Developer Tools, and noticed this error message indicating the extension is not activating properly.
VSCode version info:
I am not ruling out pilot error here, but I feel like with a fresh install it ought to probably Just Work (TM)?