[Numpy-discussion] Import fails of scipy.factorial when installed as a zipped egg

josef.pktd@gmai... josef.pktd@gmai...
Fri Jun 5 09:32:36 CDT 2009


On Fri, Jun 5, 2009 at 9:25 AM, Fadhley Salim
<Fadhley.Salim@uk.calyon.com> wrote:
> I've noticed that with scipy 0.7.0 + numpy 1.2.1, an importing the factorial
> function from the scipy module always seems to fail when scipy is installed
> as a zipped ",egg" file. When the project is installed as an unzipped
> directory it works fine.
>
> Is there any reason why this function should not be egg-safe?
>
> My test to verify this was pretty simple: I just installed my scipy egg
> (made by extracting the Windows, Python 2.4 Superpack) with the easy_install
> command. Whenever I install it with the "-Z" option (to uncompress) it works
> fine. With the "-z" option it always fails.
>

I don't think numpy/scipy are zip safe, the numpy packageloader uses
os.path to find files.
I would expect that you are not able to import anything, factorial
might be just the first function that is loaded.

easy_install usually does a check for zipsafe, and if it unpacks the
egg it usually means it's not zipsafe, for example because of the use
of __file__.

That's my guess,

Josef


More information about the Numpy-discussion mailing list