This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Make changes in the PATH and PATHEXT on installation
Type: enhancement Stage: resolved
Components: Installation, Windows Versions:
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Windows installer should add Python and Scripts directories to the PATH environment variable
View: 3561
Assigned To: Nosy List: eric.araujo, ipatrol, jonathan.hartley, loewis, ncoghlan, r.david.murray
Priority: normal Keywords:

Created on 2010-07-11 23:51 by ipatrol, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg110056 - (view) Author: (ipatrol) Date: 2010-07-11 23:51
I was fiddling around with easier ways to run python scripts in the Windows shell. I'll represent these as hypothetical AUTOEXEC.BAT entries (I used the UI for this):

;Add python to the search path so "python script.py" works
set path="%path%;C:\Python27"
;Add .py to the executable list so "script.py" works
set pathext="%pathext%;.PY"
;And finally (I couldn't find any other way) "script" works
set .py=python.exe

I think it would be a good idea to do this on installation. Any improvements and actual implementations using the registry would be greatly appreciated (especially since autoexec.bat isn't used anymore).
msg119485 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-10-24 05:14
Modifying the path has be definitely rejected by python-dev.  I don't know enough about windows to comment on the other two, but I suspect that everything that it is reasonable to do automatically is already being done.
msg134260 - (view) Author: Alyssa Coghlan (ncoghlan) * (Python committer) Date: 2011-04-22 04:14
That's not correct - we've merely pointed out that it isn't as easy as most people seem to think.

For the POSIX world, there is a version management scheme based on symlinks in /usr/bin (or /usr/local/bin) and it is easy to add and remove entries independently.

PATH on windows, on the other hand, is a size limited string that can easily exceed the bounds on development machines due to the absurdly long installation paths used by many Windows development tools (with Visual Studio itself being one of the worst offenders).

PEP 397 goes into some detail as to how the (lack of) version management is an issue for the automatically created file associations, and similar problems exist for the command line equivalents.

Batch files that launch development environments with changes to set PATH/PATHEXT/INCLUDES/LIBS etc correctly are not an uncommon sight in Windows development, so including the correct Python directory just becomes one more line in the launch scripts.

Non-command line users simply rely on the existing start menu shortcuts and the file associations to launch double-clicked files.

That limits the beneficiaries of this change to people that:
1. Want to use the command line; and
2. Do not already have a custom "Development Environment" command line launch script.

Fixing this is NOT trivial, and, to my knowledge, we have never been offered a patch that implements it.
msg134307 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-04-23 15:47
This is rejected every few months by Martin.
msg134327 - (view) Author: Alyssa Coghlan (ncoghlan) * (Python committer) Date: 2011-04-24 09:44
If it is being requested every few months, then we should reconsider rejecting it. I have now reopened #3561 instead of this one.
History
Date User Action Args
2022-04-11 14:57:03adminsetgithub: 53474
2011-04-24 09:44:49ncoghlansetmessages: + msg134327
2011-04-23 15:47:40eric.araujosetstatus: open -> closed

superseder: Windows installer should add Python and Scripts directories to the PATH environment variable
versions: - Python 2.7
nosy: + eric.araujo

messages: + msg134307
resolution: duplicate
stage: resolved
2011-04-22 13:41:03jonathan.hartleysetnosy: + jonathan.hartley
2011-04-22 04:14:29ncoghlansetstatus: pending -> open

title: Make changes in the path and pathext on installation -> Make changes in the PATH and PATHEXT on installation
nosy: + ncoghlan

messages: + msg134260
resolution: rejected -> (no value)
stage: resolved -> (no value)
2010-10-24 05:14:17r.david.murraysetstatus: open -> pending

nosy: + r.david.murray, loewis
messages: + msg119485

resolution: rejected
stage: resolved
2010-07-11 23:51:15ipatrolcreate