colaboratory will not acknowledge arviz after installation and import

952 Views Asked by At

In Google's colaboratory, installed arviz then did import arviz without error, but in a code cell, pm.plot_posterior(samples) gets error: arviz not installed.

Trying to plot Bayesian code

pm.plot_posterior(samples)

I expect a plot

2

There are 2 best solutions below

0
On

Hi did you try adding the cell magic %matplotlib inline? This may be an issue where jupyter-notebook doesn't "know" to render the plot inline

0
On

Install Arviz prior to importing PyMC3, otherwise it apparently cannot find it. In your case, simply restarting the runtime (Runtime > Restart runtime...) should get it working.