Zulip Chat Archive

Stream: general

Topic: Lean on windows


Apurva Nakade (Aug 06 2024 at 16:44):

Hi, I'm helping a colleague install lean on windows. We managed to install the lean4 plugin using VSCode. But the server is not starting.

Apurva Nakade (Aug 06 2024 at 16:45):

Also, Lake is not installed although elan and lean both exist

Eric Wieser (Aug 06 2024 at 16:45):

What does elan --version give?

Apurva Nakade (Aug 06 2024 at 16:45):

elan 3.1.1

Apurva Nakade (Aug 06 2024 at 16:46):

(71ddc6633 2024-02-22)

Eric Wieser (Aug 06 2024 at 16:46):

And for lean?

Apurva Nakade (Aug 06 2024 at 16:47):

Lean v 3.4.2

Apurva Nakade (Aug 06 2024 at 16:47):

Is this the wrong lean?

Eric Wieser (Aug 06 2024 at 16:47):

But the server is not starting.

Do you have a lean project set up?

Apurva Nakade (Aug 06 2024 at 16:48):

No we're not able to create a project as "lake" is not a recognized command

Eric Wieser (Aug 06 2024 at 16:49):

There is a button in vscode that will create the project for you I think

Eric Wieser (Aug 06 2024 at 16:50):

That should install lake at the same time

Apurva Nakade (Aug 06 2024 at 16:54):

Weirdly we're not seeing a "New project" menu item nor a "forall symbol" for creating a new project

Apurva Nakade (Aug 06 2024 at 16:59):

Actually we just restarted the app several times and it appeared. Thanks anyways!! Hopefully it'll work now.

Apurva Nakade (Aug 06 2024 at 17:16):

Now lake is having issues installing leantar. Is there a way to tell lake a location where to install leantar and the cache?

Sebastian Ullrich (Aug 06 2024 at 17:20):

Could you please include the error messages?

Apurva Nakade (Aug 06 2024 at 17:32):

Installing leantar 0.1.13
Uncaught exception: no such file or directory (error code: 2) file M:\

Apurva Nakade (Aug 06 2024 at 17:33):

We checked the environment variables and the "HOMEDRIVE" variable is set to "M:" and we're unable to change it to "C:"

Apurva Nakade (Aug 06 2024 at 18:16):

We keep getting an error:

imports are out of date and must be rebuilt; use the "restart file" command in your editor.

Kim Morrison (Aug 08 2024 at 01:17):

Does an M drive exist? If not, this seems a fundamental problem with the system.

Apurva Nakade (Aug 08 2024 at 06:16):

We're trying to get the IT guys to fix the system variables (requires admin access). But is there no way to tell lake a custom location to put the .cache directory?

Apurva Nakade (Aug 08 2024 at 06:17):

I was hoping something like --cache-dir would exist.

Sebastian Ullrich (Aug 08 2024 at 09:20):

You should be able to override HOMEDRIVE and HOMEPATH locally in the shell. Otherwise this would be a feature request to Mathlib4, as cache lives there.

Mario Carneiro (Aug 08 2024 at 17:38):

cache will use any of several environment variables to find the cache dir. The first choice is XDG_CACHE_HOME

Julian Berman (Aug 08 2024 at 18:02):

Does it look at that even on Windows?

Julian Berman (Aug 08 2024 at 18:03):

(Looks like yes -- https://github.com/leanprover-community/mathlib4/blob/340c789afdcbe26f967370ab99449ed1c87c5019/Cache/IO.lean#L47 which is a tad surprising but nice for this issue clearly)

Apurva Nakade (Aug 09 2024 at 13:19):

Thanks! This is very helpful.

Should this be added to the installation somewhere? Even on Mac or Linux I would prefer to have more control over where I store the .cache

Eric Wieser (Aug 09 2024 at 13:22):

I think XDG_CACHE_HOME is already a standard place to store things


Last updated: May 02 2025 at 03:31 UTC