为什么我不想在安装时将Python.exe添加到我的系统路径中? [英] Why wouldn't I want to add Python.exe to my System Path at install time?

查看:380
本文介绍了为什么我不想在安装时将Python.exe添加到我的系统路径中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows 7上重新安装Python,第一个对话框之一是自定义Python"屏幕.

I'm reinstalling Python, on Windows 7, and one of the first dialog boxes is the Customize Python screen.

将Python.exe添加到路径"的默认设置为整个功能将不可用."

The default setting for "Add Python.exe to Path" is "Entire feature will be unavailable."

我总是将其更改为将安装在本地硬盘上".

I always change this to "Will be installed on local hard drive."

这不是问题,更改系统环境变量很容易,但是是否还有其他选择呢?

It's not an issue, changing the system environment variables is a snap, but is there any upside to leaving this un-ticked?

推荐答案

如果您仅安装了一个版本的Python,那就没关系了.

If you only have one version of Python installed, it won't matter.

如果安装了多个版本,那么当您使用"python"命令时,将执行系统路径中出现的第一个版本.此外,它可以使旧版本无法访问而无需额外的工作.例如,我有一个安装了Python 2.7的系统,并在其上添加了3.2,并选中了在安装过程中将Python.exe添加到路径的选项.完成此操作后,在命令行上同时输入"python"和"python3"会打开Python 3.2,因此当我需要执行2.x脚本时,需要输入2.7解释器的完整路径.

If you have multiple versions installed, then the first one that appears in your system Path will be executed when you use the "python" command. Additionally, it can make older versions inaccessible without extra work. For example, I had a system with Python 2.7 installed and I added 3.2 on top of that and checked the option to to add Python.exe to the path during installation. After doing that, entering both "python" and "python3" on the command line opened up Python 3.2, so I would need to enter the full path to the 2.7 interpreter when I needed to execute 2.x scripts.

这篇关于为什么我不想在安装时将Python.exe添加到我的系统路径中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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