Why wouldn't I want to add Python.exe to my System Path at install time?

倾然丶 夕夏残阳落幕 提交于 2019-12-10 13:23:29

问题


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

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?


回答1:


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

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.




回答2:


One upside I can think of is if you run multiple python versions in windows. So, you have c:\python34 and c:\python27 but both are in the path, you'll get whichever comes first, leading you to a possibly unexpected result.



来源:https://stackoverflow.com/questions/24785562/why-wouldnt-i-want-to-add-python-exe-to-my-system-path-at-install-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!