Passing a Julia function to a Python function

My best suggestion is that you first figure out how to use the package in Python with a radically simplified version of your objective function, then port the simplified function to Julia and get it to work via PyCall, and finally replace the simplified function with the real function. The simplified function can probably be completely trivial as long as it is in the same domain as your real function.

If you get stuck on the step from Python to PyCall, the simplified function should provide a Minimal Working Example that other people can run themselves to find where the problem is.