Error Arviz not installed Using in Google Colab Pymc3

I want to plot using pm.traceplot(mcmc_trace,[‘theta’]) in Google Colab but getting error:

ImportError: ArviZ is not installed. In order to use plot_trace :

pip install arviz

NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.

Whereas I have already installed Arviz and and import arviz which works but not able to plot.

in Google colab, you need to do run the follow in one of the cell:
!pip install arviz

1 Like

I had the same problem, did what @junpenglao suggests, but that did not solve the problem.
In the end I installed the following versions of pymc3, theano and arviz to to get a working environment.
So in each Colab notebook I start with

!pip install arviz==0.6.1
!pip install pymc3==3.8
!pip install Theano==1.0.4

Bit of a pain to have to redo the install on each notebook run though.

5 Likes

That’s odd @alexisperrier ! what @junpenglao suggested does work for me without playing around with pymc3 and Theano versions in colab. OTOH, installing libraries every time in colab is a little pain but this SO thread really helped me.

1 Like

wow this is a great trick, thanks for sharing!

1 Like

@Fahad_hameed Maybe you just forgot to restart your runtime after installing arviz. Remember that whenever you install a new library, you need to restart the runtime as colab will not load installed libaries in the session in which it was installed.

1 Like

Had the same issue 4/7/2021. Installing these versions fixed the issue. Thanks!