Unable to Import Pymc, error: No module names ‘pytensor.graph.replace’

I already have pymc installed in my system and I have been using it for the past one week but today suddenly i’m unable to import it with the error - No module names ‘pytensor.graph.replace’

Can someone pls help me out here?

How did you install PyMC? Did you follow the instructions found here? What platform/operating system are you on? And how are you running python when you import PyMC (e.g., a script invoked from the command line, in VSCode, in a Jupyter notebook, etc.)?

My issue has been resolved now. I tried to re-install pymc and pytensor using conda command and uninstalled aesara, now it I am able to import is just fine.

1 Like

Another quick question here.

So with pymc3 earlier, I was able to use pm.Bound very easily. for example, I used to do:
Negnormal = pm.Bound(pm.Normal, upper=0)
x = Negnormal(“variable”, mu= , sd= )

I used to do this to fit a normal distribution but with a negative constraint. I am trying to do this in pymc5 but it doesn’t run.
Is there a workaround for this in pymc5?

I think you can/should now use the Interval transform (details here). Let me know if that doesn’t get you what you need.

You can also just use a Truncated distribution, which is the spiritual successor to Bound: pymc.Truncated — PyMC v5.2.0 documentation

2 Likes

Thanks a lot for this, really appreciate the help! :slight_smile: