[Distutils] easy_install and packages with both egg and non-egg distributions

Papa Eric papa.eric at free.fr
Fri Dec 21 00:27:38 CET 2007


Hello,

 From the documentation, unless the --upgrade option is used (or, I 
suppose, a version specifier given), easy_install is supposed to be 
content with distributions already installed on sys.path or 
site-packages. But is it true also when an egg distribution is available 
for this same package?

My problem: I have a dependency on a package xxx which is already 
installed (as a subdirectory of site-packages). If I put 
"install_requires = ['xxx']" in some setup.py, the egg will be 
downloaded. If I try "easy_install xxx" directly, this will force the 
egg distribution, too.

I don't want the egg version because it does not work, import fails on 
"zipimport.ZipImportError: can't find module 'xxx'" (yet unzipping the 
egg the xxx packages is there, if anyone has an idea of what may be 
missing...).

Also, if I remove the installed egg to used the existing distribution of 
xxx, my installed package now works well, except the script installed 
via entry_points, which seem to expect an egg in any case. So I cannot 
just "correct" the distribution by removing the wrong egg. The current 
solution I have found is not formally declare the dependency and advise 
to install xxx before...

Is this the expected behaviour? I'm using python 2.5.1, windows xp, 
setuptools 0.6c7.

Thanks for any help.


More information about the Distutils-SIG mailing list