PyError pyeval.jl not found

I am using Anaconda and when trying to use PyCall in Julia I get the following error:

ERROR: PyError ($(Expr(:escape, :(ccall(#= C:\Users\mschwarz.julia\packages\PyCall\BD546\src\pyeval.jl:38 =# @pysym(:PyEval_EvalCode), PyPtr, (PyPtr, PyPtr, PyPtr), o, globals, locals))))) <class ‘FileNotFoundError’>
FileNotFoundError(2, ‘No such file or directory’)
File “C:\Users\mschwarz.julia\packages\PyCall\BD546\src\pyeval.jl”, line 1, in
const Py_single_input = 256 # from Python.h

[1] pyerr_check
@ C:\Users\mschwarz.julia\packages\PyCall\BD546\src\exception.jl:62 [inlined]
[2] pyerr_check
@ C:\Users\mschwarz.julia\packages\PyCall\BD546\src\exception.jl:66 [inlined]
[3] _handle_error(msg::String)
@ PyCall C:\Users\mschwarz.julia\packages\PyCall\BD546\src\exception.jl:83

The file pyeval.jl does exist in the specified path.

I tried the following which didn’t help:

ENV[“PYTHON”] = “”“PyCall”)

using PyCall, Conda

This is an error from evaluating python code (PyEval_EvalCode is a Python API function) — you are apparently trying to evaluate a Python file and it is not finding it. What code are you trying to execute?

1 Like

Thanks this hint was enough, it simply couldn’t find the .py file I intended to load