Cannot import name 'stick_breaking' from 'pymc'

Hi all,

Im trying to port an application from pymc3 to pymc(5.1.2) and in the original code I have the following line:

from pymc3.distributions.transforms import stick_breaking

When I try to port to pymc I’ve got the error:

ImportError: cannot import name ‘stick_breaking’ from ‘pymc.distributions.transforms’

Couldn’t find any reference to this error elsewhere. Any simple way to fix that being someone with no deep knowlogdement on the subject?


Same error when trying the following lines:

from pymc.distributions.transforms import Transform
from pymc.distributions.transforms import interval

Hi @thnogueira, the previous stick_breaking transform is now the simplex transform in the same file name as you have in your post above. IIRC, we now have pymc.logprob.transforms.TransformRV and pymc.logprob.transforms.IntervalTransform in lieu of what the two other errors that you have indicated.

Without more knowledge on how the code you are trying to port is using these lines, these are the primary pointers that I can give you for now. I hope that this helps and will be enough for a quick fix. If not and if you want to share a bit more of your code, you’re welcome to do so and I can try to get back to you when I have time for a quick look.


Hi @larryshamalama,

First of all, thank you for your response. It seems it’s gonna be a lot of effort to update all the code so we decided to go with the original one by the moment.

The project we are trying to port is published in this Github.