Error with anonymous function example #14

Closed
MLnick opened this Issue Mar 19, 2013 · 2 comments

Comments

Projects
None yet
2 participants

MLnick commented Mar 19, 2013

Importing pylab, math, numpy all work. But passing Julia functions (whether anonymous or named) doesn't. Am I doing something wrong?

julia> @pyimport scipy.optimize as so

julia> so.newton(x -> cos(x) - x, 1)
ERROR: no method PyObject(Function,)
 in map at tuple.jl:37
 in pycall at /Users/Nick/.julia/PyCall/src/PyCall.jl:467
 in anonymous at /Users/Nick/.julia/PyCall/src/conversions.jl:82
Collaborator

stevengj commented Mar 19, 2013

Did you do a Pkg.update() to make sure you are using the latest version of PyCall? In recent versions, PyObject(f::Function) is defined on the last line of PyCall/src/callback.jl, but if you are using an old version you won't have this definition.

MLnick commented Mar 19, 2013

Ah thanks, that did it. I started from a fresh Julia build from source, did Pkg install for PyCall and it all installed so assumed it was latest version.

@MLnick MLnick closed this Mar 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment