在Windows 7上将"python2"路径添加到命令行 [英] Add “python2” path to command line on Windows 7
本文介绍了在Windows 7上将"python2"路径添加到命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直试图在Windows 7上将python2
路径添加到命令行.
I've been trying to add the python2
path to command line on Windows 7.
我尝试过这种方式:
C:\>set python2 = C:\Python27\python.exe
但是cmd
告诉我:
'python2' is not recognized as an internal or external command.
那么如何在Windows 7上将python2
路径添加到命令行?
So how can I add python2
path to command line on Windows 7?
谢谢.
推荐答案
此答案是从我自己的答案复制而来的,并且为此问题量身定制.
This answer copied from my own answer, and customized to this question.
尝试执行以下命令.
set path=%path%;c:\python27
PATH
仅针对运行上述命令的cmd.exe设置.
PATH
is set only for the cmd.exe in which you run the above command.
要永久设置PATH:
- 右键单击桌面上的我的电脑.
- 点击左侧的高级系统设置.
- 点击环境变量.
- 添加或更新
PATH
变量:- 如果不存在,请创建一个,并将值设置为
C:\python27
- 如果存在,则将
;C:\Python27
附加到现有值.
- 如果不存在,请创建一个,并将值设置为
- Right click My computer in the desktop.
- Click Advanced System Settings on the left.
- Click Environmental Variable.
- Add or Update
PATH
variable:- If it does not exist, create one, and set value as
C:\python27
- If it exist, append
;C:\Python27
to existing value.
- If it does not exist, create one, and set value as
更新
如果要使用 python2 ,请复制可执行文件.
If you want to use python2, copy the executable.
CD C:\python27
COPY python.exe python2.exe
这篇关于在Windows 7上将"python2"路径添加到命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文