pyre-check icon indicating copy to clipboard operation
pyre-check copied to clipboard

pyre from PyPI can't find its typeshed directory

Open wojdyr opened this issue 1 year ago • 1 comments

I installed pyre with pip install pyre-check on Linux.

pip show -f pyre-check shows:

Version: 0.9.19
Location: /home/wojdyr/.local/lib/python3.11/site-packages
Files:
  ../../../bin/pyre
  […]
  ../../pyre_check/typeshed/stdlib/__future__.pyi

So the typeshed is installed in /home/wojdyr/.local/lib/pyre_check/typeshed

Pyre works, but requires the user to manually specify the location:

$ pyre init
ƛ `import typeshed` failed.
ƛ Unable to locate typeshed, please enter its root:

Running it under strace, I see one relevant line:

newfstatat(AT_FDCWD, "/usr/lib/pyre_check/typeshed", 0x7ffd36707480, 0) = -1 ENOENT (No such file or directory)

It's may be not only me, there was a question on SO: https://stackoverflow.com/questions/75901930/pyre-check-cannot-located-typeshed

wojdyr avatar Jan 12 '24 13:01 wojdyr

When you run pyre init and it doesn't find the typeshed automatically, just give it the path where it's actually installed. In your case, type in: /home/wojdyr/.local/lib/pyre_check/typeshed Also, to avoid doing this every time, you can add the path to your project's .pyre_configuration file under the typeshed key. This way, Pyre will know where to look right from the start.

ebrahimsofi123 avatar Apr 15 '24 09:04 ebrahimsofi123