How to deal with AttributeError: module ‘pymc’ has no attribute ‘CustomDist’?
You probably have an old version of pymc, try to update it.
I used anaconda to installl pymc_env, how to update it? I have try install pymc>=4 again but it seems no effect.
You can activate your old environment and do conda install -c conda-forge pymc>5.2
You might have a ghost directory called pymc still in the environment. Check what’s in pymc.__path__
and if it’s empty just delete it and try to install again.
What do you get when you print pymc.__version__
?
5.3.0
That’s really odd. Can you show the full output of this exact script?
import pymc
print(pymc.__version__)
print(pymc.CustomDist)
In that script CustomDist
was found. Where are you seeing the problem, perhaps in a jupyter notebook? In that case it may not be linked to the right environment (kernel).
When I asked you to print pymc.__version__
and pymc.__path__
, I meant you should do it in the same environment/script/notebook where you were getting the error
Yes, I try in my jupyter notebook that it show version 4.4.0. How should I do next?
You need to update the pymc version in that enviroment or switch environment. I don’t know the instructions from the top of my head but google should help you there.
Ok,I see, I should try update in my jupyter notebook and it will be done. Thanks for your help and patience!