Module 'pytensor' has no attribute 'config'

Hi all, I am trying to install pymc on my M2 Mac mini, but it seems not working.
I am using:
MacOS Sonoma 14.6.1
python = 3.12.8
pytensor = 2.26.4
pymc = 5.19.1

When I import pymc, it returns the error below:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[3], line 1
----> 1 import pymc as pm

File ~/miniconda3/lib/python3.12/site-packages/pymc/__init__.py:48
     43     augmented = f"{augmented} -fno-unwind-tables -fno-asynchronous-unwind-tables"
     45     pytensor.config.gcc__cxxflags = augmented
---> 48 __set_compiler_flags()
     50 from pymc import _version, gp, ode, sampling
     51 from pymc.backends import *

File ~/miniconda3/lib/python3.12/site-packages/pymc/__init__.py:33, in __set_compiler_flags()
     29 def __set_compiler_flags():
     30     # Workarounds for PyTensor compiler problems on various platforms
     31     import pytensor
---> 33     current = pytensor.config.gcc__cxxflags
     34     augmented = f"{current} -Wno-c++11-narrowing"
     36     # Work around compiler bug in GCC < 8.4 related to structured exception
     37     # handling registers on Windows.
     38     # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782 for details.
     39     # First disable C++ exception handling altogether since it's not needed
     40     # for the C extensions that we generate.

AttributeError: module 'pytensor' has no attribute 'config'

It looks a version issue of pytensor, but if I downgrade pytensor, I will have to downgrade python. I am not sure if it worth it.

And if I create a new environment and install it by conda install -c conda-forge "pymc>=5", it seems to be fine