Error importing pymc3: AttributeError: module 'numpy' has no attribute 'bool'

I am currently running Python 3.11.5 out of jupyter notebook, and am able to intall pymc3 using the pip install command, where I get a list of “requirement satisfied” statements.

When I attempt to import, however, I get this:

AttributeError: module ‘numpy’ has no attribute ‘bool’.

The story gets even stranger. When I attempt to import Theano, I receive this error message:

AttributeError: partially initialized module ‘theano’ has no attribute ‘compile’ (most likely due to a circular import)

I’ve looked all over Stack Exchange, tried switching to an older version of NumPy, but nothing has worked. If anyone thinks they know what’s going on, I’d be so grateful for any information!


Whenever possible, please follow the installation instructions found here. You should avoid uses pip. You should also not be installing theano as PyMC no longer uses it (and it is no longer being developed).

Hi, thanks so much! I followed the installation instructions, but was unable to launch jupyter notebook from within the pymc_env, so exited out of it. Then I was unable to import pymc, so I (sorry!) did a ‘pip install pymc’, after which the import was successful and I was able to follow along with the motivating example in the page you shared.

If I were to not use pip at all, how would I gain access to pymc within a jupyter notebook?

To use jupyter you need to conda install -c anaconda jupyter as instructed here.