$ python
Python 3.8.8 (default, Apr 13 2021, 19:58:26)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymc3 as pm
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/hartlc/anaconda3/envs/pymc3/lib/python3.8/site-packages/pymc3/__init__.py", line 13, in <module>
from .stats import *
File "/home/hartlc/anaconda3/envs/pymc3/lib/python3.8/site-packages/pymc3/stats/__init__.py", line 32, in <module>
geweke = map_args(az.geweke)
AttributeError: module 'arviz' has no attribute 'geweke'
>>>
I was under the impression that if you created an environment and specified extra channels, they would be used for subsequent installs as well. I suppose this is not the case.
You need to configure that explicitly for conda forge to be used by default, setting it when creating the environment does not do the trick. Conda forge docs have some guidance on that: Tips & tricks â conda-forge 2021.04.27 documentation
Hi, new to the forum. I had quite a bit of trouble installing PyMC3 on my machine yesterday and today. I am using conda 4.10.1 on a mac (10.15.7).
I followed the install instructions:
conda install -c conda-forge pymc3
just importing the library gave me an error, then I did what AllenDowney suggested and I can confirm that worked! (thanks so much!).
I know it is not possible to test against every base OS, but is it perhaps possible to at least publish the versions that work with a specific conda release? My (limited) understanding is that arviz is bound to a specific version of pymc3. Is that published somewhere?
On a second note at the homepage there is this function:
X, y = linear_training_data()
when you copy and paste it just to see if you have a working install, it bombs. Perhaps we could put a very small test dataset in the install so a function like this works out of the box?
Thanks so much for this thread everyone! I know I could not have gotten this installed without the ideas here! thanks so much!
This has nothing to do with the conda version. It is related to the python version. The latest pymc3, numpy, pandas, matplotlib, scipy⌠no longer support python 3.6 whereas latest ArviZ does (for now, we havenât yet gotten to the drop py3.6 release but it should happen in the next release), and latest ArviZ is compatible with latest pymc3 which is what we test. The problem is that as the latest pymc3 doesnât support python 3.6, the default installation for python 3.6 is an old pymc3 with the latest arviz which doesnât work.
This is why my first recommendation was to upgrade the python version in order to be able to use latest versions of both pymc3 and arviz. Only if this is not possible I would then downgrade arviz, because in keeping python 3.6 you are renouncing to all updates of the scientific python ecosystem.
Then there is also an issue with conda not wanting to install latest pymc3 even if using a python version that is compatible with it which I sincerely have no idea why it happens and it clearly should not but ends up having the same effect (but the root causes are completely unrelated afaik) as it seems from other answers in the thread that it has no problems installing latest arviz
The bound is not with specific versions but with ranges and we are continuously working to get these ranges to be wider every time. There is therefore no document that does exactly what you ask, but the requirements.txt in pymc3 is always updated to make sure it has a correct lower bound. Therefore, if you go to https://github.com/pymc-devs/pymc3/blob/master/requirements.txt and then select the PyMC3 version you are interested in from the branch dropdown (all versions are tagged and accessible from the âtagâ tab) youâll see something like:
arviz>=0.9.0 # taken from v3.10.0 tag
which means that 0.9.0 is an arviz version compatible with pymc3 3.10.0. Follow up versions will probably be compatible too (in this particular case, I think 0.11.0 is still compatible with 3.10) but there are no guarantees anymore. By the time arviz 0.10.0 is released, maybe pymc3 has already released 3.11.0 and 0.10.0 is therefore tested against it and is never tested against 3.10.0
This is a great idea, can you open an issue for that on github?
I rebuilt all of the affected conda-forge packages for pymc3. They should all now install a compatible version of arviz so that this âgewekeâ import error no longer occurs.
Iâve tried to create a new fresh environment in Windows 10, but even by using conda-forge channel, it seems that current distribution is not setting theano properly.
My attempt here was very simple, installation was performed by running:
In [1]: import pymc3
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
What else could I be missing? Annoying warning, indeed. Should I lock to some specific version of python or any of dependency packages? I think conda-forge was working seamlessly for some of the previous versions of pymc3/theano, but it seems that there is this issue in current versions.
To summarise for anyone who may experience the same issue as I did. Install some dependencies (libpython mkl-service m2w64-toolchain numba python-graphviz scipy
) using conda-forge. Lock python version to 3.8. Install pymc3 using pip (not conda), as the final step. Warning should be gone.