简体   繁体   English

Python 在 windows 7 中未被识别为内部或外部命令

[英]Python not recognised as an internal or external command in windows 7

I have installed python 2.7.11 from this link and then restarted my system.我已经从 这个链接安装了 python 2.7.11,然后重新启动了我的系统。 However when I go to cmd and run python --version .但是,当我从 go 到 cmd 并运行python --version时。 It gives me an error that它给了我一个错误

python not recognized as an internal or external command. python 未被识别为内部或外部命令。

So I try to manually add it to my Path variable I see my python being installed at C:\Python27 so I add someotherpath;C:\Python27 to path variable and reopened windows cmd .所以我尝试手动将它添加到我的Path variable我看到我的 python 安装在C:\Python27所以我添加一些其他路径someotherpath;C:\Python27到路径变量并重新打开windows cmd But it still gives me the same error.但它仍然给我同样的错误。

Is there some other way to get over with this problem.有没有其他方法可以解决这个问题。

Thanks谢谢

Changes in PATH variable do not affect already open programs. PATH 变量的更改不会影响已打开的程序。 Close your command line (or powershell) window and reopen it in order to use new PATH variable.关闭命令行(或 powershell)窗口并重新打开它以使用新的 PATH 变量。

Please run the following command in the command prompt.请在命令提示符下运行以下命令。

echo %PATH% It should have whatever path you have set manually. echo %PATH% 它应该有你手动设置的任何路径。 Otherwise Open a new Command prompt and try the same command.否则打开一个新的命令提示符并尝试相同的命令。 Run python运行蟒蛇

If it is not working after that.如果之后它不起作用。

Please kindly check the Python.exe is available in C:\\Python or Not ?请检查C:\\Python 中的 Python.exe 是否可用?

I got same error there are two ways to solve 1)Try using py --version我遇到了同样的错误,有两种方法可以解决 1) 尝试使用 py --version

2)If py is also not recognised than uninstall python and install it again but select the add to path option as show in fig this time 2)如果py也无法识别比卸载python并重新安装但select这次添加到路径选项如图所示

解决此问题的最简单方法是重新安装 Python 并在安装过程中选中“添加到路径”按钮。

Python2.7 contains a scripts that adds location to path for windows. Python2.7包含一个脚本,用于为 Windows 路径添加位置。

So running所以跑步

C:\Python27\Tools\Scripts\win_add2path.py

solved my issue解决了我的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 python不被识别为内部或外部命令 - python is not recognised as an internal or external command 点不被识别为内部或外部命令 - pip not recognised as an internal or external command 无法将“ python2”识别为内部或外部命令。 Windows 10 - 'python2' is not recognized as an internal or external command. Windows 10 在Windows 7 cmd中调用casperjs时,无法将“ python”识别为内部或外部命令 - 'python' is not recognized as an internal or external command while calling casperjs in Windows 7 cmd "Heroku 未被识别为内部或外部命令 (Windows)" - Heroku not recognized as an internal or external command (Windows) Windows 10 conda 未被识别为内部或外部命令 - Windows 10 conda is not recognized as an internal or external command pip 在 windows7 中未被识别为内部或外部命令 - pip is not recognized as an internal or external command in windows7 Python无法识别为命令 - Python not recognised as command Python Pip安装:在命令提示符窗口中未被识别为批处理文件… - Python Pip installion: not recognised as a batch file… in command prompt windows Python 和 Windows 10:“telnet”不是内部或外部命令、可运行的程序或批处理文件 - Python and Windows 10: 'telnet' is not recognized as an internal or external command, operable program or batch file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM