[SciPy-Dev] Problem running weave, getting KeyError: 0 for anything

Nicolau Werneck nwerneck@gmail....
Fri Apr 23 11:57:36 CDT 2010

Hello. I am trying to install weave in my machine, but the is
something wrong. I can't run any examples, whatever I do I get a
KeyError: 0 message. For instance:

$ python
Python 2.6.5 (r265:79063, Mar 23 2010, 11:04:30) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy.weave
>>> a = 1
>>> scipy.weave.inline('return_val=a+2',['a'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.6/site-packages/scipy/weave/inline_tools.py", line 321, in inline
    results = attempt_function_call(code,local_dict,global_dict)
  File "/usr/local/lib/python2.6/site-packages/scipy/weave/inline_tools.py", line 389, in attempt_function_call
    function_list = function_catalog.get_functions(code,module_dir)
  File "/usr/local/lib/python2.6/site-packages/scipy/weave/catalog.py", line 612, in get_functions
    function_list = self.get_cataloged_functions(code)
  File "/usr/local/lib/python2.6/site-packages/scipy/weave/catalog.py", line 526, in get_cataloged_functions
    if cat is not None and code in cat:
  File "/usr/local/lib/python2.6/shelve.py", line 110, in __contains__
    return key in self.dict
  File "/usr/local/lib/python2.6/site-packages/scipy/io/dumbdbm_patched.py", line 73, in __getitem__
    pos, siz = self._index[key] # may raise KeyError
KeyError: 0

I get this same error regardless of the code string, BTW. I gat the
exact same message even if I put a ocmplete garbage in it. Any


Nicolau Werneck <nwerneck@gmail.com>          1AAB 4050 1999 BDFF 4862
http://www.lti.pcs.usp.br/~nwerneck           4A33 D2B5 648B 4789 0327
Linux user #460716
"The great end of life is not knowledge but action."
-- Thomas Huxley

More information about the SciPy-Dev mailing list