[SciPy-dev] Python 2.2 compatibility?

Tom Loredo loredo at astrosun.astro.cornell.edu
Thu Feb 14 15:15:16 CST 2002

Hi folks-

In my continuing attempt to build scipy with Python 2.2 on
Solaris....  Okay, now it all builds (after changing the
library list to eliminate "f90") and installs.  It just
won't load!  On "import scipy" I get:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/home/laplace/lib/python2.2/site-packages/scipy/__init__.py", line 42, in ?
    from misc import *
  File "/home/laplace/lib/python2.2/site-packages/scipy/misc.py", line 21, in ?
    import scipy.stats
  File "/home/laplace/lib/python2.2/site-packages/scipy/stats/__init__.py", line 4, in ?
    from stats import *
  File "/home/laplace/lib/python2.2/site-packages/scipy/stats/stats.py", line 204, in ?
    import math, string, sys, pstat, copy
  File "/home/laplace/lib/python2.2/site-packages/scipy/stats/pstat.py", line 176
    exec execstring
SyntaxError: unqualified exec is not allowed in function 'colex' it contains a nested function with free variables

Looks like the pstat.py module is unhappy with how 2.2 enforces
scoping.  Has this been fixed?  The scipy install page says
it works with "version 2.1 or higher" but if 2.2 requires fixes
that are only in CVS, perhaps it's time to release a more
up-to-date snapshot.

Tom Loredo

PS: One other minor obstacle I encountered:  Scipy requires
both the single and double precision libraries for FFTW.  No
problem, the FFTW install instructions tell you explicitly
how to install both versions.  However, the recommended
installation names the double version "dfftw" and the
single one "sfftw."  Scipy wants the double one named
"fftw".  It's no problem to do that, but perhaps this
requirement should be mentioned on the install page, since
it is not how FFTW suggests a dual-precision installation
be done.  Or the setup script should be changed to reflect
the FFTW recommendations.

More information about the Scipy-dev mailing list