'From/import' 不是内部或外部命令,也不是可运行的程序或批处理文件 [英] 'From/import' is not recognized as an internal or external command, operable program or batch file

查看:34
本文介绍了'From/import' 不是内部或外部命令,也不是可运行的程序或批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在从 scikit-learn 导入机器学习算法时遇到问题.我已经安装了它,但是每当我输入例如from sklearn.naive_bayes import GaussianNB"时,它都会说'from'不被识别为内部或外部命令、可运行的程序或批处理文件.我在 Windows 10 上使用 Anaconda.这是兼容性问题吗?我错过了什么吗?Idk 我还是 Python 的新手,所以我感到迷茫.谢谢

I'm having trouble importing Machine Learning algorithms from scikit-learn. I have it installed but whenever I type for example "from sklearn.naive_bayes import GaussianNB" it says " 'from' is not recognized as an internal or external command, operable program or batch file. I'm using Anaconda on Windows 10. Is it compatibility issue? Am I missing something? Idk I'm still new to Python so I feel lost. Thanks

推荐答案

这需要在 Python REPL 中运行,而不是在命令行中运行.在输入 Python 语句之前一定要开始一个.

That needs to be run in the Python REPL, not at a command line. Be sure to start one before typing Python statements.

这篇关于'From/import' 不是内部或外部命令,也不是可运行的程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆