Arviz error when using plot functions of pymc3

Have you ever had this error when calling pm.traceplot? This not gonna resolve even if I use “pip install arviz”. Any hints that I can resolve it?

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

Update to python3 and the newest version of pymc3

I did, it did not work. Then I installed anaconda again, the error changed " cannot import name ‘moduleTNC’ ". Then I changed the name of the file “moduletnc” in the folder showed in the error to the “moduleTNC”, and it worked.

1 Like

Ran into this as well after installing the newest PyMC version from anaconda forge. Installing -arviz restores plotting functionality, but the graphs look different (less aesthetically pleasing, in my opinion). Also, I don’t seem to have the moduletnc file on my computer and “conda update --all” did not help. I guess a complete anaconda reinstall is always an option, I will report back if I go that route.

This happened again for me when I updated pymc3 from version 3.6 to 3.7. After having error I also installed arviz successfully, but it gives me the same error, even after installing arviz.

Traceback (most recent call last):

File “”, line 1, in

File “C:\Users\xxxxx\AppData\Local\Continuum\anaconda3\envs\pymc3env\lib\site-packages\pymc3\”, line 42, in wrapped
return func(*args, **kwargs)

File “C:\Users\xxxxx\AppData\Local\Continuum\anaconda3\envs\pymc3env\lib\site-packages\pymc3\”, line 22, in call
“ArviZ is not installed. In order to use {0.attr}:\npip install arviz”.format(self)

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

Just to clarify, I also encountered the error after updating to 3.7. The error went away after I installed arviz via conda, but the graphs are now formatted differently. @madarshahian, did you install -arviz via pip? I guess that should not matter. Maybe someone can shed more light on the dependencies that .traceplot() needs?

If you install arviz and pymc3 master, a PR just pushed to have the same style traceplot as before (i.e., a compacted one).

1 Like

This is the latest update on a test code ( I installed pymc3 after cloning it using this command: “python install” and it installed without any error.)

yes I used pip, if I use conda, it gives me “PackagesNotFoundError”

@junpenglao any suggestion?

OK I guess I got the reason of the latest error. We should call variables in quotation mark. like: pm.traceplot(trace, ['b1','b2']);

Thank you, @junpenglao. I tried “pip install pymc3” and “pip install git+” + installing / re-installing arviz with pip. It still gives me the new style plots. These are the master branches? What am I doing wrong?

have you removed pymc3 before installing it using git?

Yes! I re-installed both packages with

pip install git+
pip install git+git://

I now get this plot style (from

It looks like the font and figure sizes are increased a bit and a barcode plot is added on the bottom (compared to what it was on my PC in the prior PyMC version). I could not figure out from PR discussions if these changes are intentional, and if the above look is the desired “compact” style, or not.

I have similar problem and I don’t like new plots on pymc3 neither. The previous format was much better.

@madarshahian, that was my initial reaction also. I think a lot of these things are a matter of personal preference though. Perhaps there will be a more flexible interface in the future, where plot style could be passed as an argument to pymc plotting function. Or better yet, plot customization will be done in a separate library, like arviz, or other. As a probabilistic programming newbie, I am just in continuous awe of how easy PyMC is to use and how well it works. I think a big part of that is an active developer community that constantly improves it. Though the rapid changes may seem like an inconvenience at times, I think they are precisely what makes this library so great.

1 Like

Yea, can’t agree more. For plot, I think more flexibility would help a lot. Another thing I did not like about new plot package is forest plot, which previously R_hat was added on the right, and also you can enter label. Now to do that I need to write more lines of code.

1 Like

I had a similar issue and followed the advice in the error code: “pip install arviz”, but that didn’t help. Finally I did “pip uninstall arviz”, followed by “conda install -c conda-forge arviz”, restarted my kernel and then it worked fine.