Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UndefVarError: y not defined for iteration in Python back to Julia #134

Closed
femtomc opened this issue Mar 23, 2022 · 1 comment
Closed

UndefVarError: y not defined for iteration in Python back to Julia #134

femtomc opened this issue Mar 23, 2022 · 1 comment

Comments

@femtomc
Copy link

femtomc commented Mar 23, 2022

I keep running into this UndefVarError issue when passing iterators from Julia back over to Python.

I think generally this most frequently occurs during list comprehensions.

ERROR: LoadError: Python: Julia: UndefVarError: y not defined
Stacktrace:
  [1] errset
    @ ~/.julia/packages/PythonCall/B5irB/src/err.jl:28 [inlined]
  [2] pyjliter_next(self::PythonCall.Iterator)
    @ PythonCall ~/.julia/packages/PythonCall/B5irB/src/jlwrap/iter.jl:19
  [3] _pyjl_callmethod(f::Any, self_::Ptr{PythonCall.C.PyObject}, args_::Ptr{PythonCall.C.PyObject}, nargs::Int64)
    @ PythonCall ~/.julia/packages/PythonCall/B5irB/src/jlwrap/base.jl:58
  [4] _pyjl_callmethod(o::Ptr{PythonCall.C.PyObject}, args::Ptr{PythonCall.C.PyObject})
    @ PythonCall.C ~/.julia/packages/PythonCall/B5irB/src/cpython/jlwrap.jl:47
  [5] PyObject_CallObject
    @ ~/.julia/packages/PythonCall/B5irB/src/cpython/pointers.jl:290 [inlined]
  [6] macro expansion
    @ ~/.julia/packages/PythonCall/B5irB/src/Py.jl:129 [inlined]
  [7] pycallargs
@femtomc femtomc changed the title y not defined for iteration from Python back to Julia UndefVarError: y not defined for iteration in Python back to Julia Mar 23, 2022
@cjdoris
Copy link
Collaborator

cjdoris commented Mar 23, 2022

You're on an old version of PythonCall, you should update.

@cjdoris cjdoris closed this as completed Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants