467,879 Members | 1,224 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,879 developers. It's quick & easy.

How does IPython modify the sys.path?

Hello all:

I installed IPython on my XP machine today and find that my sys.path
has been changed
as follows:
>import sys
print sys.path
['',
'C:\\Program Files\\Python24\\scripts',
'C:\\WINDOWS\\system32\\python24.zip',
'C:\\Documents and Settings\\Daniel\\Desktop',
'C:\\Program Files\\Python24\\DLLs',
'C:\\Program Files\\Python24\\lib',
'C:\\Program Files\\Python24\\lib\\plat-win',
'C:\\Program Files\\Python24\\lib\\lib-tk',
'C:\\Program Files\\Python24',
'C:\\Program Files\\Python24\\lib\\site-packages',
'C:\\Program Files\\Python24\\lib\\site-packages\\PIL',
'C:\\Program Files\\Python24\\lib\\site-packages\\win32',
'C:\\Program Files\\Python24\\lib\\site-packages\\win32\\lib',
'C:\\Program Files\\Python24\\lib\\site-packages\\Pythonwin',
'C:\\Program Files\\Python24\\lib\\site-packages\\wx-2.6-msw-ansi',
'C:\\Program Files\\Python24\\lib\\site-packages\\reportlab_2_0',
'C:\\Program Files\\Python24\\lib\\site-packages\\IPython/Extensions',
'C:\\Documents and Settings\\Daniel\\_ipython']
Obviously, IPython changed my sys.path and added an entry in the end as
"C:\\Documents and Settings\\Daniel\\_ipython'"
However, I cannot figure out how IPython can change my sys.path.

I refer to all the following sources
1http://www.python.org/doc/current/inst/search-path.html Installing
Python Modules
2KEY_LOCAL_MACHINE\Software\Python\PythonCore\2.4\ PythonPath
3My machine has no environment variable "PYTHONPATH"
4There is no *.pth file under
C:\Program Files\Python24\Lib\site-packages
that contains that information (i.e. C:\\Documents and
Settings\\Daniel\\_ipython)
So how dos IPython modify my sys.path without trace???

Thank you very much!
-Daniel

Sep 22 '06 #1
  • viewed: 4496
Share:
2 Replies
Daniel Mark wrote:
So how dos IPython modify my sys.path without trace???
sys.path.append()

Specifically, line 321 of ipmaker.py

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Sep 22 '06 #2
Daniel Mark wrote:
However, I cannot figure out how IPython can change my sys.path.

I refer to all the following sources
1http://www.python.org/doc/current/inst/search-path.html Installing
Python Modules
2KEY_LOCAL_MACHINE\Software\Python\PythonCore\2.4\ PythonPath
3My machine has no environment variable "PYTHONPATH"
4There is no *.pth file under
C:\Program Files\Python24\Lib\site-packages
that contains that information (i.e. C:\\Documents and
Settings\\Daniel\\_ipython)
did you look up sys.path in the documentation ?

A list of strings that specifies the search path for modules.
Initialized from the environment variable PYTHONPATH, plus an
installation-dependent default. /.../

A program is free to modify this list for its own purposes.

http://pyref.infogami.com/sys.path

</F>

Sep 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Yaroslav Bulatov | last post: by
1 post views Thread by Ismael Herrera | last post: by
reply views Thread by Fernando Perez | last post: by
4 posts views Thread by Daniel Mark | last post: by
5 posts views Thread by Lou Pecora | last post: by
reply views Thread by Ville Vainio | last post: by
1 post views Thread by Karlo Lozovina | last post: by
reply views Thread by Marko Bozikovic | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.