-
Notifications
You must be signed in to change notification settings - Fork 28
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
Import "gi.repository.GLib" could not be resolved from source #189
Comments
Is your vim using a LSP or something that is actually aware of typestubs? If it's analyzing "real" code only it won't find it. |
The typestubs are normal PEP 561 typestubs. If your editor or type checker does not find them then they are most likely not installed or something is not configured correctly on your end. Did you make sure to read the README and specifiy the config-settings to tell what stubs to generate? You can try uninstalling the typestubs and reinstalling them, with the config-settings. Make sure to pass After this, check if the typestubs are recognized by pyright itself (without VS Code). |
As @lashawn said, the stubs work fine. The only problem is the warning. That's all. |
But if the imports are not resolved then how can the stubs work? Are you sure the warning isn't coming from VSCode itself? |
are you maybe using virtual environments? or conda environments? if yes you need to install the stubs in these environments. if your stubs work otherwise, maybe open a issue on the pylance or pyright tracker and ask what the problem could be. other things to check that come to mind
Side Note: |
Yes, i use venv. |
I solved this issue by adding following rule to [tool.pyright]
reportMissingModuleSource = false |
After I did: pip install pygobject-stubs --no-cache-dir --config-settings=config=Gtk4,Gdk4,Soup3 (for gtk4), or just the default install(pip install pygobject-stubs pygobject), my vim still reports above warning, it runs, but the warning stays no matter what.
The text was updated successfully, but these errors were encountered: