4

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

merv
  • 67,214
  • 13
  • 180
  • 245
2tan2ten
  • 109
  • 1
  • 9

2 Answers2

4

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.

merv
  • 67,214
  • 13
  • 180
  • 245
0

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

canyon289
  • 3,355
  • 4
  • 33
  • 41