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.

Title: python directory not added to PATH
Type: enhancement Stage:
Components: None Versions:
Status: closed Resolution: wont fix
Dependencies: Superseder: Windows installer should add Python and Scripts directories to the PATH environment variable
View: 3561
Assigned To: Nosy List: afayolle, christian.heimes, tim.peters
Priority: normal Keywords:

Created on 2001-11-16 16:54 by afayolle, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Messages (5)
msg53337 - (view) Author: Alexandre Fayolle (afayolle) Date: 2001-11-16 16:54
On installation on Windows platforms, the python
directory is not added to the PATH, which makes it
difficult to launch python through batch files for

Alexandre Fayolle
msg53338 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2001-11-24 02:10
Logged In: YES 

I changed this to a feature request:  it's not "a bug" 
because we don't try to set PATH.  My experience with an 
earlier Tcl/Tk installer that did try to set PATH convinces 
me I'm not going to try to do it at all:  it requires too 
many gimmicks across Windows flavors, can fail in dangerous 
ways on Win9x boxes, and if you're writing .bat files for 
Windows you know how to set it yourself anyway (but by 
hand, where you have a fighting chance of detecting and 
recovering from failure modes).
msg53339 - (view) Author: Alexandre Fayolle (afayolle) Date: 2001-11-26 08:20
Logged In: YES 

Thanks for the quick answer.

I agree that it's not a "bug". Let's make it a feature
request then. 

However, the need is real, not for people writing their own
batch file, but rather for people writing and distributing
cross platform Python applications. On unix, we have the #!
/usr/bin/env python trick, but there's nothing similar on
windows. Having the Python directory on the PATH could help. 

I've tried to do it for an application I maintain, and I
agree that it's a pain (I too got bitten by the space in
"Program Files"), but I think it's more a Python's job to
ensure that the executable is in the PATH. 



msg53340 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2001-12-02 22:40
Logged In: YES 

I'm not clear on what problem you're trying to solve.  
Fiddling PATH is highly anti-social on Windows, so I'm 
opposed to it even if it were easy (embedded spaces are 
easy; there are many ways to screw up a Win9x box by 
failures in editing autoexec.bat, from line-length 
limitations to failing to handle multiple PATH lines 

You can find the location of Python's install directory via 
the registry.  You can also use "start" (or 
os.startfile() from within Python) to use the registered 
executable for .py and .pyw files.  That's how Windows is 
supposed to be used.

In any case, PythonLabs doesn't have the bandwidth to 
fiddle with this even if I <wink> wanted to; any change 
here would have to be implemented by a community volunteer; 
or if it's important enough to pay for it, ActiveState may 
be willing to implement it in their installer.

BTW, if I were distributing a serious Windows app using 
Python, I'd ship the version of Python I used and install 
it along with my app, into a subdirectory of my app's 
directory.  That's how, e.g., PythonWare distributes their 
apps.  Then you have total control over it.
msg59250 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-01-04 19:40
This bug is about 6 years old. Please discuss the matter on the python
dev mailing list if you are still interested in the problem.
Date User Action Args
2022-04-10 16:04:38adminsetgithub: 35536
2011-04-23 15:37:13eric.araujosetsuperseder: Windows installer should add Python and Scripts directories to the PATH environment variable
2008-01-04 19:40:56christian.heimessetstatus: open -> closed
nosy: + christian.heimes
resolution: wont fix
messages: + msg59250
2001-11-16 16:54:31afayollecreate