Problems when import newest pymc3 version (3.11.1)

When I import the newest pymc3 version (3.11.1), an error occured:
AttributeError: 'TheanoConfigParser' object has no attribute 'gcc__cxxflags'
How to fix it?

That could be because you still have the old theano installed (instead of the new fork Theano-pymc). Try to uninstall PyMC and Theano and install PyMC again.

Thank you. I had tried to reinstall these two packages(theano==1.0.5, pymc==3.11.1, arviz==0.11.2), but the error still exists.
I also tried to install the old version (pymc==3.9.3, arviz==0.10.0), but it emerged a new error when executing ‘scan’:
TypeError: Unknown parameter type: <class 'theano.tensor.var.TensorVariable'>
I was really confused because I have never met this kind of error when I use this old version to run the same program previously. Have you met this kind of error?

Sorry if I was unclear. You shouldn’t use theano anymore but instead use theano-pymc. This should be installed automatically when you install the new version of Pymc. You should uninstall the old theano as it can interfere with the new theano-pymc

Thank you. I tried uninstalled theano module, but my programme still need use functions in theano package like scan. Can all the functions of theano be replaced by which in theano-pymc?

Yes, theano-pymc has all the functions that theano has. Everything works the same, it’s still called theano inside python and everything has the same name. If you install it correctly when you import it this is what you should see:

import theano
print(theano.__version__)
'1.1.0'

In the next pymc release theano-pymc will be renamed aesara, in part, to avoid this sort of problems.

But I cannot import scan function:

from pymc3.distributions.timeseries import scan

AttributeError: module 'theano' has no attribute 'config'
or

from theano import scan

File “…/theano/scan/init.py”, line 50, in

from theano import configdefaults

ImportError: cannot import name 'configdefaults' from 'theano' (unknown location)

Can you even import theano (and print the version)? What is your operating system by the way? We have a guide here on the safest way to install the latest version of pymc3: GitHub - pymc-devs/pymc3: Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Theano

I can import theano but failed to print version, the operating system is Linux. I will read the guide later. I really appreciate your help!

I found that the package can be normally imported in Windows system, but I still cannot print version or import scan function in Linux system. I guess it maybe the operating system difference cause this problem.

I succeeded importing it without any bugs after deleting the folder about theano in site-packages and reinstalling it. Thank you very much!

I am glad you managed!