无法从Sklearn导入方法(使用VSCODE)

发布于 2025-01-28 21:58:15 字数 463 浏览 2 评论 0原文

我正在使用vscode,并且我导入kdtree这样的

from sklearn.neighbors import KDTree

时候,当kdtree停留在白色时(这意味着VSCODE找不到此方法)

我在Linux上使用Python3.8,而Mac

< 3.9强>附加信息: 我已经安装了sklearn,然后在sklearn.neighbors中检查了 init .py文件

sklearn.neighbors inte init .py .py

为什么kdtree零件持续白色?

I'm using VSCode, and I import KDTree like this

from sklearn.neighbors import KDTree

while the KDTree stays in white(which means VSCode cannot find this method)

I'm using python3.8 on my Linux and 3.9 on my Mac

addtional info:
I've installed sklearn, and I checked init.py file in sklearn.neighbors

It looks like this
sklearn.neighbors init.py

Why the KDTree parts stays in white?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

且行且努力 2025-02-04 21:58:15

如果kdtree没有以预期的颜色突出显示,则并不意味着VS代码找不到此方法。这可能意味着您尚未在程序中访问此方法。尝试创建kdtree对象,它应该按预期工作。

请注意,如果您尚未安装“ Sklearn”,则需要先在使用sklearn.kdtree之前先安装它。

If KDTree is not highlighted in the expected color, it doesn't mean VS-Code could not find this method. It could just mean that you have not accessed this method yet in your program. Try creating a KDTree object, it should work as expected.

Note that if you haven't installed "sklearn" yet, you would need to install it first before using sklearn.KDTree.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文