Zulip Chat Archive

Stream: new members

Topic: leanproject


Michael Beeson (Sep 14 2021 at 07:35):

Suddenly "leanproject" doesn't work:

beeson@iMac inf % leanproject build
zsh: command not found: leanproject
beeson@iMac inf % ls
Junk _target leanpkg.path leanpkg.toml src
beeson@iMac inf %

Johan Commelin (Sep 14 2021 at 07:44):

maybe reinstall mathlibtools?

Johan Commelin (Sep 14 2021 at 07:44):

does your shell still find elan and lean executables?

Michael Beeson (Sep 14 2021 at 07:55):

No, it doesn't. I bet this has to do with making zsh the default shell; I think Apple did that in a recent update.

Mario Carneiro (Sep 14 2021 at 07:56):

can you just start up bash or whatever you were using before and then access lean et al?

Patrick Massot (Sep 14 2021 at 07:59):

Can you use other command line tools using python?

Michael Beeson (Sep 14 2021 at 08:00):

I can start python3, no problem

Michael Beeson (Sep 14 2021 at 08:01):

bash-3.2$ leanproject build
bash: /Users/beeson/.local/bin/leanproject: /Users/beeson/.local/pipx/venvs/mathlibtools/bin/python: bad interpreter: No such file or directory
bash-3.2$

Michael Beeson (Sep 14 2021 at 08:01):

So at least bash does recognize "leanproject".

Michael Beeson (Sep 14 2021 at 08:02):

brew upgrade elan mathlibtools
produced an error message
Error:
homebrew-core is a shallow clone.

Mario Carneiro (Sep 14 2021 at 08:05):

do python or python3 work?

Michael Beeson (Sep 14 2021 at 08:06):

Yes python3 works.

Mario Carneiro (Sep 14 2021 at 08:06):

it looks like you might need to symlink python to python3

Mario Carneiro (Sep 14 2021 at 08:06):

there is probably a command for this?

Michael Beeson (Sep 14 2021 at 08:08):

python works too. I don't see the point of a symlink. Would like to know what the problem is rather than try random things. I did not change anything (except to accept making zsh the default shell).

Mario Carneiro (Sep 14 2021 at 08:08):

but not /bin/python?

Mario Carneiro (Sep 14 2021 at 08:09):

the error sounds like there is nothing at that location

Michael Beeson (Sep 14 2021 at 08:18):

Now I did
pipx uninstall mathlibtools && brew install mathlibtools

and after that I get this (so at least leanproject starts up):

beeson@iMac inf % leanproject build
Building project inf
[Errno 2] No such file or directory: 'leanpkg'

Michael Beeson (Sep 14 2021 at 08:31):

Aha! I did
source ~/.profile

and after that leanproject works normally again. Thanks for trying to help.

Julian Berman (Sep 14 2021 at 14:19):

Definitely don't symlink python to python3 on macOS

Julian Berman (Sep 14 2021 at 14:20):

If the instructions we just added for migrating installs don't cover this let me know, but hopefully that final command you ran came from finding https://leanprover-community.github.io/install/macos_details.html#aside-migrating-from-older-installations ?

Julian Berman (Sep 14 2021 at 14:21):

FWIW, bash: /Users/beeson/.local/bin/leanproject: /Users/beeson/.local/pipx/venvs/mathlibtools/bin/python this error normally means "homebrew upgraded your python, and that breaks all your virtualenvs because that's not a safe thing to do"

Julian Berman (Sep 14 2021 at 14:22):

That issue is documented here: https://github.com/leanprover-community/mathlib-tools/issues/94 but my recommendation is still that we close that, because this new way that you're now on (which doesn't use pipx directly) does not have that issue anymore.


Last updated: Dec 20 2023 at 11:08 UTC