Hi all, I have been using PyMC for ~3 weeks now without issue, however have recently run into some problems when trying to import the package (note, this was not happening as of last week). More specifically, when trying to import pymc3, I get the following error “AttributeError: module ‘arviz’ has no attribute ‘geweke’”
I have tried reinstalling PyMC3 as well as Arviz with no luck, so I am hoping somebody here can help me out, thanks in advance!
Full Traceback:
> AttributeError Traceback (most recent call last)
in
1 import arviz as az
----> 2 import pymc3 as pm
3 import theano
4 from statsmodels.formula.api import glm as glm_sm
5 import statsmodels.api as sm
/opt/conda/envs/Python-3.6-WMLCE/lib/python3.6/site-packages/pymc3/init.py in
62 from .sampling import *
63 from .smc import *
—> 64 from .stats import *
65 from .step_methods import *
66 from .tests import test
Not sure if you are on colab or not, but the root issue is python 3.6. Latest PyMC3 versions (like latest numpy, scipy, matplotlib…) dropped python 3.6 support some months ago, however it looks like we forgot to explicitly drop py3.6 support on ArviZ which results on latest ArviZ being install which is not compatible with pymc3 3.10. Forcing ArviZ<=0.10 (maybe even <=0.11.0) should fix the issue.
If you are not on colab however, I strongly recommend using python>=3.8 and updating to both latest ArviZ and PyMC3
Now running into a new issue when using ArviZ = 0.11.0
ImportError Traceback (most recent call last)
in
1 import arviz as az
----> 2 import pymc3 as pm
3 import theano
4 from statsmodels.formula.api import glm as glm_sm
5 import statsmodels.api as sm
/opt/conda/envs/Python-3.6-WMLCE/lib/python3.6/site-packages/pymc3/init.py in
37
38
—> 39 __set_compiler_flags()
40
41 from . import gp, ode, sampling
/opt/conda/envs/Python-3.6-WMLCE/lib/python3.6/site-packages/pymc3/init.py in __set_compiler_flags()
31 def __set_compiler_flags():
32 # Workarounds for Theano compiler problems on various platforms
—> 33 import theano
34
35 current = theano.config.gcc.cxxflags
/opt/conda/envs/Python-3.6-WMLCE/lib/python3.6/site-packages/theano/init.py in
108 object2, utils)
109
→ 110 from theano.compile import (
111 SymbolicInput, In,
112 SymbolicOutput, Out,
/opt/conda/envs/Python-3.6-WMLCE/lib/python3.6/site-packages/theano/compile/init.py in
26 from theano.compile.builders import *
27
—> 28 from theano.compile.function import function, function_dump
/opt/conda/envs/Python-3.6-WMLCE/lib/python3.6/site-packages/theano/compile/function/init.py in
5 from collections import OrderedDict
6
----> 7 from theano.compile.function.pfunc import pfunc
8 from theano.compile.function.types import orig_function
9
/opt/conda/envs/Python-3.6-WMLCE/lib/python3.6/site-packages/theano/compile/function/pfunc.py in
8
9 from theano import config
—> 10 from theano.compile.function.types import UnusedInputError, orig_function
11 from theano.compile.io import In, Out
12 from theano.compile.profiling import ProfileStats
/opt/conda/envs/Python-3.6-WMLCE/lib/python3.6/site-packages/theano/compile/function/types.py in
21 from theano.gof import graph
22 from theano.gof.op import ops_with_inner_function
—> 23 from theano.gof.toolbox import is_same_graph
24
25
ImportError: cannot import name ‘is_same_graph’
Guessing this is a further problem with Python version, now with Theano. I am working on Watson Studio and cannot upgrade my python very easily, so will have to be using older package versions unfortunately
This is already sorted out in the newer releases (in fact, this was never broken with the latest releases of the two packages, we already have extensive testing for that, but it’s not possible to test all old versions) and we can’t go back to already released versions of the packages to edit their requirements. I don’t think there is anything else we can do, if there were please let us know and/or volunteer and help us do it.
Fresh conda environment → conda install pymc3 → immediately get the above problem. Solution suggested by Allen did NOT work for me (instead my kernel dies as soon as I try to import pymc3). python=3.8.8; pymc3=3.8; arviz = 0.11.0 (after downgrade)