Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/marco.forgione/anaconda3/envs/bda/lib/python3.11/site-packages/pymc/__init__.py", line 47, in <module>
__set_compiler_flags()
File "/Users/marco.forgione/anaconda3/envs/bda/lib/python3.11/site-packages/pymc/__init__.py", line 30, in __set_compiler_flags
import pytensor
File "/Users/marco.forgione/anaconda3/envs/bda/lib/python3.11/site-packages/pytensor/__init__.py", line 119, in <module>
from pytensor import scalar, tensor
File "/Users/marco.forgione/anaconda3/envs/bda/lib/python3.11/site-packages/pytensor/tensor/__init__.py", line 105, in <module>
from pytensor.tensor import sharedvar # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/marco.forgione/anaconda3/envs/bda/lib/python3.11/site-packages/pytensor/tensor/sharedvar.py", line 8, in <module>
from pytensor.tensor.type import TensorType
File "/Users/marco.forgione/anaconda3/envs/bda/lib/python3.11/site-packages/pytensor/tensor/type.py", line 746, in <module>
pytensor.compile.register_view_op_c_code(
^^^^^^^^^^^^^^^^
AttributeError: partially initialized module 'pytensor' has no attribute 'compile' (most likely due to a circular import)
I othewise installed the package successfully on a x86 linux machine. Also, I previously had installed pymc v5.7.2 on my macbook with the same procedure and it used to work.
Not sure I get your question. I installed on a Macbook Pro M2, thus Silicon architecture and I got the error. I also installed on a x86 linux machine and everything was fine there.
In both cases, I created a fresh conda environment with the command
conda create -c conda-forge -n pymc_env "pymc>=5"
as per the official documentation on the pymc website.
I don’t have any specific requirements; I just use PyMC for teaching Bayesian data analysis to undergrads and try to ensure that we don’t spend the first lecture troubleshooting installation issues across all platforms.
Hi. I’m facing similar issues: M2Pro with Sonoma. I tried this, but in trying to install theano or theano-pymc I run into conflicts with my python version (3.11).
Is there a particular python version you’d recommend? pymc_env kept my own.
PyMC does not use theano these days but pytensor which is installed automatically with PyMC. Most of the old theano/theano.tensor code should work similarly as pytensor/pytensor.tensor
Got it. Long story short, I’m starting with probabilistic programing using Martin et al ‘Bayesian Modeling’, which is based on PyMC 3, but their env is not compatible with my Mac. Took me a while to figure all out. I’m starting with PyMC 5 and then will go back to the book. Thanks!