When I am custom likelihood example I get pickle error when multiple chains are used

Hello Everyone,

I am trying to use this example ([https://docs.pymc.io/notebooks/blackbox_external_likelihood.html](http://Black Box Example))) without gradient part. However, I get the pickling error when using lambda function and number of chains > 1.

Could some body please point me to the correct direction? When I read though various messages on this forum, it has been suggested that the latest version fixes the problem. I am using the latest version from the repo.
I am on Windows 10 and using python 3.7 .

Thank you

I think I figured it out. After trial and error
is it possible to correct this very helpful example (please see the link in my question). I replaced the density function
pm.DensityDist(‘likelihood’, lambda v: logl(v), observed={‘v’: theta})]

pm.Potential(‘likelihood’, logl(theta))

kind regards

FYI, the pickle error is because of the lambda function (it couldn’t be pickled). Turn it into def ... should work.