[IPython-User] Problem with Windows startup script

Klonuo klonuo@gmail....
Sun Mar 13 03:51:29 CDT 2011


I don't know if this is addressed yet, but seeing it behaviour on Windows PC
probably not

Dealing with starting IPython on Windows; batch scripts created by IPython 
installation process, that call IPython in Windows does not work if Python
is installed in it's default location "C:\Program Files\Python"

Here is template on which this couple of scripts are based:

-----------------------
@C:\Program Files\Python\python.exe C:\Program Files\Python\scripts\ipengine.py %*
-----------------------

And here is how they should look like, to work for end-user:

-----------------------
@"C:\Program Files\Python\python.exe" "C:\Program Files\Python\scripts\ipengine.py" %*
-----------------------

just enclosed in double quotes to handle possible whitespace in path

Also if installer notices that there are multiple Python versions, startup 
scripts will fail for any Python dist other that default set. It can be
solved by setting PYTHONHOME env var in startup script.

For example if I have Python 2.5 and Python 2.6, and Python 2.5 is my default
dist, than to make IPython startup script to work for Python 2.6,
startup script needs to be changed like this:

-----------------------
REM path to Python 2.6 interpreter set to PYTHONHOME env var
set PYTHONHOME=C:\Program Files\Python26
@"C:\Program Files\Python26\python.exe" "C:\Program Files\Python26\scripts\ipengine.py" %*
-----------------------

Environment variable PYTHONHOME this way is set only locally, for the time beying
of that process, it does not change default set globally



More information about the IPython-User mailing list