[SciPy-user] debugging scipy

Robert Kern robert.kern@gmail....
Sat Dec 29 15:29:11 CST 2007

Georg Holzmann wrote:
> Hallo!
> I have a problem using scipy in the python debugger (I do that with the 
> eric4 IDE).
> When I step through the commands, I got the an error (only in debug 
> mode!) at the statement:
> "import scipy"
> and the error is:
> ------8<--------
> The file 
> /usr/lib/python2.5/site-packages/setuptools-0.6c7-py2.5.egg/pkg_resources.py 
> could not be opened.
> ------8<--------
> and then:
> ------8<--------
> The debugged program raised the exception OSError
> "[Errno 2] No such file or directory: '/home/holzi/scipytest/test'"
> File: 
> /usr/lib/python2.5/site-packages/setuptools-0.6c7-py2.5.egg/pkg_resources.py, 
> Line: 1659
> Break here?
> ------8<--------
> But my setuptools installation seems to be ok and the file 
> /usr/lib/python2.5/site-packages/setuptools-0.6c7-py2.5.egg/ is present.
> (my scipy version is 0.6.0, Python 2.5.1)
> Has anyone a hint what I can try to resolve this problem ?

Eric apparently does not know anything about zipped eggs. The setuptools egg is
zipped and pkg_resource.py is inside of it. In debug mode, I imagine it tries to
load the source of every module that gets imported.

Remove the lines in scipy/__init__.py:

    import pkg_resources as _pr # activate namespace packages (manipulates __path__)
    del _pr
except ImportError:

I'm not really sure why we put them there, though.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

More information about the SciPy-user mailing list