RuntimeError with new numpy/scipy

48 views
Skip to first unread message

Xinyue Ye

unread,
Sep 26, 2012, 5:53:24 PM9/26/12
to pysa...@googlegroups.com
I used Python 2.7, Scipy 0.11.0, and NumPy 1.7.0b2 with pysal 1.4, an
error is reported when i typed "Import pysal" in python gui.

>>> import pysal
RuntimeError: module compiled against API version 7 but this version
of numpy is 6

Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import pysal
File "C:\Python27\lib\site-packages\pysal\__init__.py", line 38, in <module>
import pysal.cg
File "C:\Python27\lib\site-packages\pysal\cg\__init__.py", line 4, in <module>
from shapes import *
File "C:\Python27\lib\site-packages\pysal\cg\shapes.py", line 12, in <module>
from sphere import arcdist
File "C:\Python27\lib\site-packages\pysal\cg\sphere.py", line 11, in <module>
import scipy.spatial,scipy.constants
File "C:\Python27\lib\site-packages\scipy\spatial\__init__.py", line
25, in <module>
from kdtree import *
File "C:\Python27\lib\site-packages\scipy\spatial\kdtree.py", line
6, in <module>
import scipy.sparse
File "C:\Python27\lib\site-packages\scipy\sparse\__init__.py", line
180, in <module>
from csr import *
File "C:\Python27\lib\site-packages\scipy\sparse\csr.py", line 12, in <module>
from sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
File "C:\Python27\lib\site-packages\scipy\sparse\sparsetools\__init__.py",
line 4, in <module>
from csr import *
File "C:\Python27\lib\site-packages\scipy\sparse\sparsetools\csr.py",
line 25, in <module>
_csr = swig_import_helper()
File "C:\Python27\lib\site-packages\scipy\sparse\sparsetools\csr.py",
line 21, in swig_import_helper
_mod = imp.load_module('_csr', fp, pathname, description)
ImportError: numpy.core.multiarray failed to import
>>>

--
Xinyue Ye, Ph.D.
Assistant Professor of GIScience, School of Earth, Environment and Society
Assistant Professor of Spatial Economics, Center for Regional Development
(Department of Commerce EDA University Center)
Bowling Green State University
http://personal.bgsu.edu/~xye/

Xinyue Ye

unread,
Sep 26, 2012, 5:58:59 PM9/26/12
to pysa...@googlegroups.com
i also tried numpy 1.6.2; the same error was reported.

Serge Rey

unread,
Sep 26, 2012, 6:03:31 PM9/26/12
to pysa...@googlegroups.com
can you import numpy and scipy separately and list what versions are
being loaded?
--
Sergio (Serge) Rey
Professor, School of Geographical Sciences and Urban Planning
GeoDa Center for Geospatial Analysis and Computation
Arizona State University
http://geoplan.asu.edu/rey

Editor, International Regional Science Review
http://irx.sagepub.com

Charles Schmidt

unread,
Sep 26, 2012, 6:04:36 PM9/26/12
to pysa...@googlegroups.com
Xinyue,

This looks like a numpy or scipy problem. Try...
>>> import numpy
>>> import scipy
>>> import scipy.sparse

Charlie.

Xinyue Ye

unread,
Sep 26, 2012, 6:07:48 PM9/26/12
to pysa...@googlegroups.com
but if I use Scipy 0.10.1 instead of Scipy 0.11.0, pysal works.

xinyue

unread,
Sep 27, 2012, 5:46:03 PM9/27/12
to pysa...@googlegroups.com
it will not work if we use Scipy 0.11.0 for any of the following combination:
is there any problem with Scipy 0.11.0?

xinyue

unread,
Sep 27, 2012, 5:48:10 PM9/27/12
to pysa...@googlegroups.com
I  can import numpy and scipy separately.


On Wednesday, September 26, 2012 6:03:31 PM UTC-4, serge wrote:

Serge Rey

unread,
Sep 27, 2012, 8:20:21 PM9/27/12
to pysa...@googlegroups.com
I can't reproduce your error:

(P1_5S11)serge:~VIRTUAL_ENV/ $ python

[17:19:09]
Python 2.7.3 |CUSTOM| (default, Apr 12 2012, 11:28:34)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysal
>>> pysal.version
'1.4.0'
>>> import scipy
>>> scipy.version
<module 'scipy.version' from
'/Users/serge/Documents/python/P1_5S11/lib/python2.7/site-packages/scipy/version.pyc'>
>>> scipy.version.version
'0.12.0.dev-fd68897'
>>> import numpy
>>> numpy.version.version
'1.6.2'
Reply all
Reply to author
Forward
0 new messages