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

pyright couldn't resolve submoudle. #562

Closed
2 tasks done
JoeMob opened this issue Mar 11, 2023 · 3 comments
Closed
2 tasks done

pyright couldn't resolve submoudle. #562

JoeMob opened this issue Mar 11, 2023 · 3 comments
Labels
educational Issues that contain useful content env Issues caused by incorrect environment settings (terminal, package manager, etc.) lsp LSP related issues usage User-specific issues

Comments

@JoeMob
Copy link

JoeMob commented Mar 11, 2023

Version confirmation

  • Confirm

Following prerequisites

  • Confirm

Neovim version

NVIM v0.8.2

Operating system/version

win 11

Terminal name/version

wezterm

$TERM environment variable

No response

Branch info

main (Default/Latest)

Fetch Preferences

SSH (use_ssh = true)

Affected language servers

pyright

How to reproduce the issue

1.Import open3d.
2.Call open3d's submodule visualization.

Actual behavior

image

Expected behavior

There should be no error reported.

Support info

image
image

Logs

[START][2023-03-11 17:06:27] LSP logging initiated
[WARN][2023-03-11 17:06:27] ...lsp/handlers.lua:487	"stubPath typings is not a valid directory."

Additional information

No response

@JoeMob JoeMob added bug Something isn't working lsp LSP related issues labels Mar 11, 2023
@ayamir
Copy link
Owner

ayamir commented Mar 11, 2023

We can't resolve this kind of problems because it belongs to the inherent ability of pyright. All of my suggestion is to use other lsps.

@Jint-lzxy
Copy link
Collaborator

TL;DR If you are using a type stub for the library and you believe that the stub is missing a symbol, report the problem (or submit a PR) with the maintainer of that type stub (open3d). We can't do much about this as it's server- and user-dependent.


This appears to be a problem with the type stub file that ships with open3d. It probably doesn't include the visualization symbol in it's top-level specification. It is up to library authors to determine what symbols they want to export as part of the official interface contract, and those symbols must be defined in the typestub file. pyright itself is very configurable and the default port without any configuration will generate many errors that might be insignificant. Please refer to https://microsoft.github.io/pyright/#/configuration.

A dirty workaround would be to simply import the submodule:

import open3d.visualization

@Jint-lzxy Jint-lzxy added invalid This doesn't seem right usage User-specific issues env Issues caused by incorrect environment settings (terminal, package manager, etc.) wontfix This will not be worked on and removed bug Something isn't working labels Mar 12, 2023
@CharlesChiuGit CharlesChiuGit added the educational Issues that contain useful content label Mar 12, 2023
@Jint-lzxy Jint-lzxy removed the invalid This doesn't seem right label Mar 12, 2023
@JoeMob
Copy link
Author

JoeMob commented Mar 12, 2023

I disabled the error message, but pyright's behavior still doesn't match my expectation. Cuz open3d doesn't have stubs, visualization is just a subfolder under open3d's root and it also imported in the __init__.py of open3d.
But my problems are not related to dotfiles, so I will close my issue.

@JoeMob JoeMob closed this as completed Mar 12, 2023
@Jint-lzxy Jint-lzxy removed the wontfix This will not be worked on label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
educational Issues that contain useful content env Issues caused by incorrect environment settings (terminal, package manager, etc.) lsp LSP related issues usage User-specific issues
Projects
None yet
Development

No branches or pull requests

4 participants