Skip to content
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

it not working in vscode #7

Open
mahaidong opened this issue Aug 24, 2020 · 5 comments
Open

it not working in vscode #7

mahaidong opened this issue Aug 24, 2020 · 5 comments

Comments

@mahaidong
Copy link

when I try to type import Rhino.
It said

unresolved import 'Rhino'
@gonzalocasas
Copy link

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.
image

@mahaidong
Copy link
Author

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.
image

hi, gonzalocasas

Do you have autocompleting for rhino module after you import rhino?

@gonzalocasas
Copy link

gonzalocasas commented Sep 29, 2020

Do you have autocompleting for rhino module after you import rhino?

yep

image

@mahaidong mahaidong reopened this Sep 29, 2020
@sbaer
Copy link
Member

sbaer commented May 24, 2021

@mahaidong we just published a new version of the stubs to pypi. Does this version work in VS Code for you now?

@theTonyHo
Copy link
Contributor

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants