astral-sh / rye

a Hassle-Free Python Experience
https://rye.astral.sh
MIT License
13.6k stars 466 forks source link

Imports not resolved by pyright 1.1.371 #1215

Closed catwell closed 2 months ago

catwell commented 2 months ago

Steps to Reproduce

mkdir repro
cd repro
rye init
rye add quart
echo "import quart" > src/repro/foo.py
rye install pyright
pyright

Expected Result

0 errors, 0 warnings, 0 informations

Actual Result

.../repro/src/repro/foo.py:1:8 - error: Import "quart" could not be resolved

Version Info

rye 0.36.0 commit: 0.36.0 (12c024c7c 2024-07-07) platform: linux (x86_64) self-python: cpython@3.12.2 symlink support: true uv enabled: true

More details

I don't know whether to consider this a pyright bug or a Rye bug. I opened a corresponding issue on pyright.

I think the reason is that they are doing some form of sandboxing of the Python interpreter so I'd be more inclined to consider it is a bug on their end, still this will probably be a problem for many Rye users so I am duplicating here.

rchiodo commented 2 months ago

This should be pyright/pylance's fault. I don't believe it's an issue with Rye.

catwell commented 2 months ago

OK, I am closing this issue then, thanks.