pymc-devs/pymc — Issue #73: issue with latest scipy(.misc).derivative
Author: doctorBenton
Created: 2011-12-05 08:25:58+00:00
State: open

I've just had to do a clean reinstall of everything on a macbookpro.

I'm doing through macports. Here's what i have that is relevant:
python27 @2.7.2_3 (active)
py27-numpy @1.6.1_1 (active)
py27-scipy @0.10.0_0+gcc44 (active)
py27-matplotlib @1.1.0_0+ghostscript+latex+tkinter (active)
py27-pymc @2.0_0+gcc44 (active)

The problem is that pymc fails to load normally, because it says it can't find scipy, with the error message:
normApprox = pymc.NormApprox( model )
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pymc/NormalApproximation.py", line 483, in __init__
raise ImportError, 'Scipy must be installed to use NormApprox and MAP.'
ImportError: Scipy must be installed to use NormApprox and MAP.

I think the problem is that in the latest scipy, scipy.derivate has moved to scipy.misc.derivative.

I haven't been brave enough to try altering the source code, but i find the error disappears if i do the following:

import scipy
from scipy.misc import derivative
scipy.derivative = derivative

I've no idea what (if any) difference there is between the old scipy.derivative, and the new sci.misc.derivative, but everything seems okay-ish in any case.

Hope that's helpful, even if it's somewhat mundane.