Struggling to import HDDM - AttributeError: module 'pymc' has no attribute 'stochastic_from_dist'

I’m trying to import HDDM to do drift diffusion modelling for a psychology reaction time experiment.

I’m getting the following AttributeError irrespective of whether I try to install pymc and import hddm on Google Colab OR locally (macOS Monterey v12.1; python version 3.9.12) on JupyterLab desktop.

The code:

!pip install scikit-learn
!pip install tensorflow-gpu==1.15 # tf 1.15 ~ 4 times faster (feel free to test this out)
!pip install h5py==2.10.0
!pip install cython
!pip install pymc
!pip install kabuki
!pip install -U --no-deps git+https://github.com/hddm-devs/hddm@alex_dev

import hddm

The error:


AttributeError Traceback (most recent call last)
in ()
6
7 #
----> 8 import hddm
9
10 # Make simulators visible

4 frames
/usr/local/lib/python3.7/dist-packages/kabuki/utils.py in ()
310 return pm.flib.cauchy(x, 0, S) + len(x) * np.log(2)
311
→ 312 HalfCauchy = pm.stochastic_from_dist(name=“Half Cauchy”,
313 random=centered_half_cauchy_rand,
314 logp=centered_half_cauchy_logp,

AttributeError: module ‘pymc’ has no attribute ‘stochastic_from_dist’

HDDM depends on pymc v2, which you need to install via

pip install pymc==2.3.8