Zulip Chat Archive

Stream: new members

Topic: Having some issues with importing


Ryan Gold (May 12 2021 at 18:11):

Every time I try to import something, an error appears in VS code, along the lines of
file 'data/nat/gcd' not found in the search path Use 'lean --path' to see where lean is looking, or https://leanprover-community.github.io/file-not-found.html for more primes.lean:1:0 invalid import: data.nat.gcd could not resolve import: data.nat.gcd
I tried reinstalling mathlib, and configured the project using the commands in the tutorial. Any help would be appreciated. (Using lean 3, by the way)

Bryan Gin-ge Chen (May 12 2021 at 18:15):

Which tutorial did you follow?

Kevin Buzzard (May 12 2021 at 18:16):

Did you look at the URL in the error message for the list of common reasons as to why this is happening?

Ryan Gold (May 12 2021 at 18:23):

I followed the instructions here: https://leanprover-community.github.io/install/project.html ,
I checked the URL, and it said it couldn't find a leanpkg.toml

Kevin Buzzard (May 12 2021 at 18:24):

I mean did you read the suggestions at https://leanprover-community.github.io/file-not-found.html

Ryan Gold (May 12 2021 at 18:25):

Yes, I did. I already completed the first of the two, and the second told me to enter leanproject get-mathlib-cache into the terminal, which I did.

This output Could not find a leanpkg.toml

Bryan Gin-ge Chen (May 12 2021 at 18:26):

How did you create your Lean project? Did you use something like leanproject new your_project_name?

Kevin Buzzard (May 12 2021 at 18:26):

If you haven't got a leanpkg.toml then you haven't got a valid lean project. Can you post a screenshot of VS Code showing the problem?

Bryan Gin-ge Chen (May 12 2021 at 18:27):

(Specifically, I think we'd like to see the files in the directory you've opened in VS Code.)

Ryan Gold (May 12 2021 at 18:28):

Think I got it fixed now. I screwed up something when configuring the directories.


Last updated: Dec 20 2023 at 11:08 UTC