running script error (eigen symmetric)

Sean Farley sean.michael.farley at gmail.com
Tue Dec 4 12:49:04 PST 2012


On Mon, Dec 3, 2012 at 10:35 AM, Amy Anderson <amyla333 at gmail.com> wrote:
> Dear macports-users,
>
> I am a new macports, python, and scipy user and I am looking for some help
> to troubleshoot an error I have been getting when trying to run a script in
> python. The script I am trying to run is called pyCluster ROI and it needs
> python, pynifti, scipy, and numpy to run. I have installed all these
> programs successfully using macports on Mac OS 10.8.
>
>
> I unarchived the scripts and ran the test script getting this error:
>
> $ python pyClusterROI_test.py
>
> Traceback (most recent call last):
>
>   File "pyClusterROI_test.py", line 48, in <module>
>
>     from make_local_connectivity_scorr import *
>
>   File
> "/Users/matthewnye/Downloads/pyClusterROI/make_local_connectivity_scorr.py",
> line 40, in <module>
>
>     from scipy.sparse.linalg.eigen.arpack import eigen_symmetric
>
> ImportError: cannot import name eigen_symmetric
>
>
> I have been trying to hunt down what this error may be and it seems that
> older versions of scipy might have used
> ‘scipy.sparse.linalg.eigen.arpack.eigen symmetric()’  where as new versions
> it has been renamed as "scipy.sparse.linalg.eigen.arpack.eigs()."
>
>
> Does anyone know what might be causing this error or if it is a version
> problem, is there any way to get an older version of scipy through macports?
> Also I have considered installing all these modules through a manual install
> but since i am a novice user I did not want to attempt that if there was a
> potentially simpler solution.

Woah, woah, woah now. Let's not go down the (more difficult) rabbit
hole of installing an older version of a port. For this issue, there
is a much easier solution (so please undo all the installations of an
older scipy, etc.). After scipy 0.9.0, the function 'eigen_symmetric'
was renamed to 'eigsh'. All you have to do is run,

$ perl -i -pe 's,eigen_symmetric,eigsh,g' *.py

in the pyClusterROI directory and you should get much further along.
Alternatively, attached is a patch if you would prefer that, which you
can run with,

$ patch -p1 < /path/to/eigen_symmetric.patch

For reference, I'm able to get to script to run on the test data and
produce subject{1,2,…,etc.}.nii.gz. Also, as a bonus, I was able to
get this pyClusterROI thing to work with the newer nibabel (which
replaces pynifty [macports devs:I'll create a ticket later today to
file these]). You can use the attached nibabel.patch to try it out.

Though, judging by the age of this script, you might find a suitable
replacement here (which is also where the pynifti replacement lives),

http://nipy.sourceforge.net

Hope that helps!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eigen_symmetric.patch
Type: application/octet-stream
Size: 3888 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20121204/b912d0b4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nibabel.patch
Type: application/octet-stream
Size: 15898 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20121204/b912d0b4/attachment-0001.obj>


More information about the macports-users mailing list