[SciPy-User] First attempt to import scipy.stats fails

PHobson at Geosyntec.com PHobson at Geosyntec.com
Tue Mar 9 19:08:05 EST 2010


But the second one works fine -- so it's not really an issue that bothers me, but I thought it might interest some folks. Here's an IPython session that demonstrates the issue:

Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)]
...
IPython 0.10 -- An enhanced Interactive Python.
...
In [1]: import numpy as np

In [2]: import scipy as sp

In [3]: import scipy.stats as st
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

c:\stuff\utils\py\<ipython console> in <module>()

C:\Python26\lib\site-packages\scipy\stats\__init__.py in <module>()
      5 from info import __doc__
      6
----> 7 from stats import *
      8 from distributions import *
      9 from rv import *

C:\Python26\lib\site-packages\scipy\stats\stats.py in <module>()
    201
    202 #import scipy.stats  #is this a circular import ?

--> 203 from morestats import find_repeats #is only reference to scipy.stats
    204 import distributions
    205

C:\Python26\lib\site-packages\scipy\stats\morestats.py in <module>()
      5 import statlib
      6 import stats
----> 7 import distributions
      8 from numpy import isscalar, r_, log, sum, around, unique, asarray
      9 from numpy import zeros, arange, sort, amin, amax, any, where, \

C:\Python26\lib\site-packages\scipy\stats\distributions.py in <module>()
     25 from scipy.special import gammaln as gamln
     26 from copy import copy
---> 27 import vonmises_cython
     28 import textwrap
     29

c:\stuff\utils\py\numpy.pxd in scipy.stats.vonmises_cython (scipy\stats\vonmises_cython.c:2939)()

ValueError: numpy.dtype does not appear to be the correct type object

In [4]: import scipy.stats as st

In [5]: np.__version__
Out[5]: '1.4.0'

In [6]: sp.__version__
Out[6]: '0.7.1'

Paul M. Hobson                  
Senior Staff Engineer
-- 
Geosyntec Consultants 
55 SW Yamhill St, Ste 200
Portland, OR 97204
Phone: 503.222.9518
www.geosyntec.com





More information about the SciPy-User mailing list