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

mypy扫描提示错误:error: Skipping analyzing "khl": module is installed, but missing library stubs or py.typed marker #228

Open
axiangcoding opened this issue Mar 7, 2024 · 5 comments

Comments

@axiangcoding
Copy link

Describe the bug
mypy扫描提示错误:error: Skipping analyzing "khl": module is installed, but missing library stubs or py.typed marker

To Reproduce

mypy ./folder

Expected behavior
根据错误提示,

note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

可知,这类问题是因为库未类型化引起的。

是否有计划增加类型化处理,来避免这个扫描错误?

Logs/Screenshots

Environment

  • Python version: 3.12
  • khl.py version: 0.3.17
  • OS: Windows

Additional context
此外,用vscode似乎无法自动 from khl import xxx,似乎也是这个问题导致的

@hank9999
Copy link
Contributor

hank9999 commented Mar 7, 2024

可以考虑先配置忽略一下,目前库里应该是没有生成stub
如果不想忽略,可以克隆这个仓库手动生成后从本地安装进pip

@hank9999
Copy link
Contributor

hank9999 commented Mar 7, 2024

PS: stub用于类型检查,应该可能大概也许跟vscode import报错无关

@axiangcoding
Copy link
Author

可以考虑先配置忽略一下,目前库里应该是没有生成stub 如果不想忽略,可以克隆这个仓库手动生成后从本地安装进pip

我暂时忽略了对这个库的检查,这个倒是问题不大

@axiangcoding
Copy link
Author

PS: stub用于类型检查,应该可能大概也许跟vscode import报错无关

vscode的auto import故障,但是手动import后,依然能够提供补全。所以也不太影响使用。这个问题我发现类似缺少stub的库都会这样,我推测应该是同个问题导致的

@hank9999
Copy link
Contributor

hank9999 commented Mar 7, 2024

PS: stub用于类型检查,应该可能大概也许跟vscode import报错无关

vscode的auto import故障,但是手动import后,依然能够提供补全。所以也不太影响使用。这个问题我发现类似缺少stub的库都会这样,我推测应该是同个问题导致的

没怎么用过VSCode写Python不是很了解这个(

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

2 participants