NameError:未定义名称"python" [英] NameError: name 'python' is not defined
本文介绍了NameError:未定义名称"python"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Windows命令行中遇到此错误,进行了广泛的搜索,但没有完美的答案.请在下面找到错误并帮助解决.
Am encountering this error in Windows Command line,done a wide search but could not get a perfect answer.Please find the error below and help in solving.
python
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'python' is not defined
>>>
预先感谢
推荐答案
您似乎正在尝试通过运行命令python
来启动Python解释器.
It looks like you are trying to start the Python interpreter by running the command python
.
但是解释器已经启动.它将python
解释为变量的名称,但未定义该名称.
However the interpreter is already started. It is interpreting python
as a name of a variable, and that name is not defined.
请改用此方法,您应该希望看到Python的安装按预期运行:
Try this instead and you should hopefully see that your Python installation is working as expected:
print("Hello world!")
这篇关于NameError:未定义名称"python"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文