[英]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.