-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editable modules installed by uv aren't found #731
Comments
i'm not really familiar with how editable packages work, but i wasn't able to reproduce the issue by running
thanks |
Sorry, should have been more specific here. It's happening when installing another package as editable, like |
hmm, i'm still not able to reproduce it. according to the documentation about editable installs, it should work as long as it uses after you install the package as editable, can you try restarting the language server and see if the issue persists? (F1 > "Tasks: Run Task" > "basedpyright: Restart Server") |
oh wait i think i misunderstood how this works. that config is specified on the build backend, as in the build tool on the package you're installing rather than what you're installing it with. from my understanding uv does not have a build backend yet (astral-sh/uv#3957), so the way to get your package to work with (based)pyright depends on whatever build backend it uses. hope the documentation i linked in the previous comment helps |
closing this as i'm pretty sure my comment above explains the situation. i also clarified the docs in #770. let us know if you're still having issues and we can re-open this if needed |
Thanks, that works perfectly. Just to leave the solution right here, one can use either |
I'm using uv as my package manager. When I install modules as editable (with
-e
), the module cannot be resolved by Pyright:Import mymodule could not be resolved. basedpyright(reportMissingImports)
With verbose output enabled, there is one potentially interesting message logged:
uv does seem to create a
.pth
though. In this case, it's located at.venv/lib/python3.12/site-packages/__editable__.mymodule-1.0.0.pth
and contains:The referenced module contains the
MAPPING
andNAMESPACES
.When I install the module without
-e
, the types are found.The text was updated successfully, but these errors were encountered: