简化无法导入Sklearn模块

发布于 2025-02-13 23:37:50 字数 705 浏览 2 评论 0原文

我只是想在此处学习一些有关数据科学的知识,并遵循本教程:

https://www.youtube.com/watch?v=8m20lyczdoy 我运行该程序,它说即使我通过pip3安装了Sklearn,也没有安装它终端:

pip install scikit-learn

这是错误:

ModuleNotFoundError: No module named 'sklearn'

Traceback:

File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/streamlit/scriptrunner/script_runner.py", line 554, in _run_script
    exec(code, module.__dict__)

File "/Users/jeettan/Desktop/python-programming/programming.py", line 3, in <module>
    from sklearn import datasets

有什么想法吗?

I'm just trying to learn a bit about data science here and following this tutorial:
https://www.youtube.com/watch?v=8M20LyCZDOY

However, when I run the program, it says that sklearn isn't installed even though I installed it through pip3 and pip with the code on my terminal:

pip install scikit-learn

Here was the error:

ModuleNotFoundError: No module named 'sklearn'

Traceback:

File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/streamlit/scriptrunner/script_runner.py", line 554, in _run_script
    exec(code, module.__dict__)

File "/Users/jeettan/Desktop/python-programming/programming.py", line 3, in <module>
    from sklearn import datasets

Any ideas?

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

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

发布评论

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

评论(1

穿越时光隧道 2025-02-20 23:37:50

这起作用了:

sudo pip3 install scikit-learn

我尝试使用pip3 install scikit-learn,但它不起作用,但是在技巧之前添加sudo

This worked:

sudo pip3 install scikit-learn

I tried with pip3 install scikit-learn but it did not work, but adding sudo before did the trick.

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