SciPy error: object has no attribute ‚decorate‘

When using the linker cross reference table to graphviz dot file conversion script from https://balau82.wordpress.com/2013/11/24/analyzing-c-source-files-dependencies-in-a-program/, I get the error:

$ ./cref2dot.py
Traceback (most recent call last):
  File "./cref2dot.py", line 5, in 
    from networkx import MultiDiGraph, write_dot
  File "/usr/lib/python2.7/dist-packages/networkx/__init__.py", line 82, in 
    import networkx.linalg
  File "/usr/lib/python2.7/dist-packages/networkx/linalg/__init__.py", line 9, in 
    from networkx.linalg.algebraicconnectivity import *
  File "/usr/lib/python2.7/dist-packages/networkx/linalg/algebraicconnectivity.py", line 24, in 
    from scipy.sparse.linalg import eigsh, lobpcg
  File "/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/__init__.py", line 112, in 
    from .isolve import *
  File "/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/isolve/__init__.py", line 6, in 
    from .iterative import *
  File "/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/isolve/iterative.py", line 84, in 
    def bicg(A, b, x0=None, tol=1e-5, maxiter=None, xtype=None, M=None, callback=None):
  File "/usr/lib/python2.7/dist-packages/scipy/_lib/_threadsafety.py", line 59, in decorator
    return lock.decorate(func)
  File "/usr/lib/python2.7/dist-packages/scipy/_lib/_threadsafety.py", line 47, in decorate
    return scipy._lib.decorator.decorate(func, caller)
AttributeError: 'module' object has no attribute 'decorate'

The error occurs in scipy/_lib/_threadsafety.py at

...
    def decorate(self, func):
        def caller(func, *a, **kw):
            with self:
                return func(*a, **kw)
        return scipy._lib.decorator.decorate(func, caller)
...

It occurs with Debian package python-scipy, version 0.10.1+dfsg2-1, maintained by the Debian Python Modules Team, and can befixed by changing the above return statement to:

...
        return scipy._lib.decorator.decorator(caller, func)
...
426 mal insgesamt angesehen, 2 mal heute angesehen.
Dieser Beitrag wurde unter Bug reports & Feature requests abgelegt und mit , , , , , , verschlagwortet. Setze ein Lesezeichen auf den Permalink.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.