pythonstubs
pythonstubs copied to clipboard
it not working in vscode
when I try to type import Rhino. It said
unresolved import 'Rhino'
On my side, it works, but it still complains.
I have pylance
enabled, and it complains on the import line that there's no module source, but autocomplete actually works.
On my side, it works, but it still complains.
I have
pylance
enabled, and it complains on the import line that there's no module source, but autocomplete actually works.
hi, gonzalocasas
Do you have autocompleting for rhino module after you import rhino?
Do you have autocompleting for rhino module after you import rhino?
yep
@mahaidong we just published a new version of the stubs to pypi. Does this version work in VS Code for you now?
@mahaidong Seems like the expected behavior. You can set up the stubs files from pypi as module imports, see the solution and the difference options below, depending on your needs.
Solution 1 - Autocomplete and resolve import (typically set up for real code)
python.analysis.extraPaths
- Add paths to stub folders as additional modules, can be relative. Remove the postfix -stubs
in the stub folders. i.e. Rhino to treat them as modules.
Solution 2 - Only autocomplete (has reportMissingModuleSource
warning) (I assume this is how you currently have it)
python.analysis.stubPath
- Default: ./typings
. Open your project folder and place all stub folders in this folder.
Refer to PyLance Settings