sys.path[] question

ElChino elchino at cnn.cn
Sun Oct 29 07:31:29 EDT 2017


Thomas Jollans wrote:

> You can find out where a module is loaded from by checking its __file__
> attribute. Run python (in interactive mode) and execute
> 
>>>> import pyreadline
>>>> pyreadline.__file__

Thanks for that tip.

>> 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' ?
> 
> This sounds like a fairly high risk of breaking something (presumably
> there is some reason the files are where they are) for absolutely no
> gain. It's not like it takes up any meaningful amount of space, is it?
> Why would you want to?

True, disk space is a few cents per Gigabyte. But maybe to reduce the
clutter on my disk and to keep things neat and simple.
I feel as a Python newbie, the file-structure / residue from various
package-installs clutters the 'Lib/site-packages' a great deal.
There is probably a tool to analyse "dead" Python package installs?



More information about the Python-list mailing list