sys.path[] question

ElChino elchino at cnn.cn
Sat Oct 28 13:24:47 EDT 2017


 From the Python2.7 snippet in [1], Python2.7 reports that my
sys.path[] contains:
   f:\ProgramFiler\Python27\lib\site-packages\pyreadline-2.0-py2.7-win32.egg

(a .zip-file)

But I have also a 'f:\ProgramFiler\Python27\lib\site-packages\pyreadline'
directory. With the complete package AFAICS.

So my question is where will Python import a 'import pyreadline' from?
E.f. if I do a:
   python -vv f:\ProgramFiler\Python27\lib\site-packages\pyreadline\test\test_lineeditor.py

it shows a:
   # zipimport: found 89 names in F:\ProgramFiler\Python27\lib\site-packages\pyreadline-2.0-py2.7-win32.egg
But no other references to pyreadline-2.0-py2.7-win32.egg.

Does that mean that only this .egg is where python imports all pyreadline
files from? And if so, can I delete
   'f:\ProgramFiler\Python27\lib\site-packages\pyreadline' ?

------

[1]: in a py-path.bat file:
    f:\ProgramFiler\Python27\python.exe -c "import sys; [sys.stdout.write('%%2d: %%s\n' %% (i,p)) for (i,p) in 
enumerate(sys.path)]"




More information about the Python-list mailing list