Zulip Chat Archive

Stream: new members

Topic: leanproject: command not found


Merel Steenbergen (Dec 06 2022 at 10:15):

I have tried to install Lean by following this tutorial:
https://leanprover-community.github.io/install/windows.html, I've also checked the youtube video to make sure everything was correct. Leanprover in VS Code works so far (haven't been able to run a project obviously, but #eval 1+1 does give me the expected output). However, when I try to get the leanproject I need to run, my bash returns bash: leanproject: command not found

I am using: Windows10, Git version 2.37.0.windows.1, Python 3.8.5.

I have already tried:

  • Reïnstalling (also when opening Git Bash as administrator, I saw that in an old chat)
  • source ~/.profile
  • Rebooting my PC
  • I've checked whether the elan/lib is in my PATH variable (it is)

Can anyone help me?

Eric Wieser (Dec 06 2022 at 10:20):

Note that leanproject is unrelated to elan, and is described in this section

Eric Wieser (Dec 06 2022 at 10:21):

The TL;DR is pip install mathlibtools

Merel Steenbergen (Dec 06 2022 at 10:22):

Eric Wieser zei:

The TL;DR is pip install mathlibtools

I did that and it installed, that's why I don't know why it's not working

Eric Wieser (Dec 06 2022 at 10:22):

What does pip -V give?

Merel Steenbergen (Dec 06 2022 at 10:22):

pip 22.3.1 from C:\Users\merel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip (python 3.8)

Eric Wieser (Dec 06 2022 at 10:23):

That's a pretty unusual path; how did you install python?

Eric Wieser (Dec 06 2022 at 10:24):

Does python -m mathlibtools.leanproject work for you?

Merel Steenbergen (Dec 06 2022 at 10:24):

I think it might be using a version I have installed through my university. I'll try to reinstall Python.

Eric Wieser (Dec 06 2022 at 10:24):

I wouldn't do that yet

Merel Steenbergen (Dec 06 2022 at 10:24):

Eric Wieser zei:

Does python -m mathlibtools.leanproject work for you?

Yes

Eric Wieser (Dec 06 2022 at 10:25):

Great, then that just means that python's Scripts/ directory is not on your PATH

Eric Wieser (Dec 06 2022 at 10:25):

Does C:\Users\merel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts exist for you?

Merel Steenbergen (Dec 06 2022 at 10:25):

Eric Wieser zei:

Great, then that just means that python's Scripts/ directory is not on your PATH

I'll check and fix it! Thanks!

Merel Steenbergen (Dec 06 2022 at 10:26):

Eric Wieser zei:

Does C:\Users\merel\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts exist for you?

Yes

Eric Wieser (Dec 06 2022 at 10:26):

Great, add that to your path and you should be done (assuming leanproject is in there)

Merel Steenbergen (Dec 06 2022 at 10:31):

Eric Wieser zei:

Great, add that to your path and you should be done (assuming leanproject is in there)

It works! Thanks so much :)

gaming with yoty (May 19 2023 at 21:20):

I followed the same steps, pip -V gives: "pip 23.1.2 from C:\Users\yotam\AppData\Roaming\Python\Python310\site-packages\pip (python 3.10)"
yet there is no leanproject file in C:\Users\yotam\AppData\Roaming\Python\Python310\Scripts, what do I do (I'm using windows 11 if that matters)

Eric Wieser (May 19 2023 at 21:34):

What does where leanproject give? nevermind

Eric Wieser (May 19 2023 at 21:34):

As a workaround you can use python -m mathlibtools.leanproject instead of leanproject

gaming with yoty (May 19 2023 at 21:38):

I have indeed been doing that, I just thought there might be a way to still use leanproject

Julian Berman (May 19 2023 at 23:05):

What does python -m pip -V say?

Julian Berman (May 19 2023 at 23:07):

You seem to have at least 2 Python installs from the above, a 3.8 and a 3.10 (which is fine, but your python and your pip might not be from the same one).

Eric Wieser (May 19 2023 at 23:25):

Julian, as far as I can tell the 3.8 version was a different user

Julian Berman (May 20 2023 at 00:47):

Oh, indeed, well done me.

gaming with yoty (May 20 2023 at 09:20):

Julian Berman said:

What does python -m pip -V say?

well, for the record, python -m pip -V says:
pip 23.1.2 from C:\Users\yotam\AppData\Roaming\Python\Python310\site-packages\pip (python 3.10)

Julian Berman (May 20 2023 at 14:04):

OK, and you see no leanproject in the scripts directory? You can try pip install --force-reinstall mathlibtools and see if that helps.

gaming with yoty (May 20 2023 at 15:19):

That worked! Thank you so much!


Last updated: Dec 20 2023 at 11:08 UTC