[Python-Dev] how to easily consume just the parts of eggs that are good for you

Chris McDonough chrism at plope.com
Thu Mar 27 03:34:14 CET 2008


zooko wrote:
> Folks:
>> Here is a simple proposal: make the standard Python "import" 
> mechanism notice eggs on the PYTHONPATH and insert them (into the 
> *same* location) on the sys.path.
>> This eliminates the #1 problem with eggs -- that they don't easily 
> work when installing them into places other than your site-packages 
> and that if you allow any of them to be installed on your system then 
> they take precedence over your non-egg packages even you explicitly 
> put those other packages earlier in your PYTHONPATH. (That latter 
> behavior is very disagreeable to more than a few prorgammers.)

Sorry if I'm out of the loop and there's some subtlety here that I'm 
disregarding, but it doesn't appear that either of the issues you mention is a 
actually problem with eggs. These are instead problems with how eggs get 
installed by easy_install (which uses a .pth file to extend sys.path). It's 
reasonable to put eggs on the PYTHONPATH manually (e.g. 
sys.path.append('/path/to/some.egg')) instead of using easy_install to install them.
I don't think there would be any benefit to changing Python's import machinery 
to deal with them; they are essentially just directories (or zipfiles) that 
contain packages.
- C


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /