[SciPy-dev] Problem in stats.py

eric eric at scipy.org
Mon Feb 18 01:25:41 EST 2002


>
> Hello Folks,
>
> I just discovered a problem in the latest version of stats.py. In line 1637
> it tries to import special directly. Changing this in scipy.special fixes
> this, but then it is complaining about not finding neginomcdfinv. For the
> time being I reverted back to the old version of the stats module.
>
> Heiko

Travis O. cleaned this up, but I'm getting the same problem  - except with
possioncdf.  If I try:

C:\WINDOWS\SYSTEM32>python
Python 2.1.1 (#20, Jul 20 2001, 01:19:29) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> from scipy import *
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "C:\Python21\scipy\__init__.py", line 74, in ?
    names2all(__all__, _level0, globals())
  File "C:\Python21\scipy\__init__.py", line 42, in names2all
    exec("import %s" % name, gldict)
  File "<string>", line 1, in ?
  File "C:\Python21\scipy\misc.py", line 22, in ?
    import scipy.stats
  File "C:\Python21\scipy\stats\__init__.py", line 4, in ?
    from stats import *
  File "C:\Python21\scipy\stats\stats.py", line 1637, in ?
    from scipy.special import binomcdf, binomcdfc, binomcdfinv, betacdf, betaq,
fcdf, \
ImportError: cannot import name possioncdf

But, if I comment out this:

from scipy.special import binomcdf, binomcdfc, binomcdfinv, betacdf, betaq,
fcdf, \
     fcdfc, fp, gammacdf, gammacdfc, gammaq, negbinomcdf, negbinomcdfinv #, \
#     possioncdf, poissioncdfc, possioncdfinv, studentcdf, studentq, \
#     chi2cdf, chi2cdfc, chi2p, normalcdf, normalq, smirnovcdfc, smirnovp, \
#     kolmogorovcdfc, kolmogorovp

>>> from scipy import *
<it works!>
>>>

What gets me is that a dir(scipy.special) shows that possioncdf and friends are
there as they should be.  I don't understand, then, why the import statement
fails.  It seems like either they all would fail, or none would fail.  Any ideas
why the first 14 functions work and the others fail?

eric






More information about the SciPy-Dev mailing list