# Julia script works, but MethodError when using Python PyJulia

**URL:** <https://discourse.julialang.org/t/julia-script-works-but-methoderror-when-using-python-pyjulia/60915>\
**Category:** New to Julia\
**Tags:** python\
**Created:** [May 10, 2021, 8:57pm UTC](https://discourse.julialang.org/t/julia-script-works-but-methoderror-when-using-python-pyjulia/60915 "2021-05-10T20:57:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![seiji](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@seiji](https://discourse.julialang.org/u/seiji)\
**Post date:** [May 10, 2021, 8:57pm UTC](https://discourse.julialang.org/t/julia-script-works-but-methoderror-when-using-python-pyjulia/60915/1 "2021-05-10T20:57:47Z")

</div>

First post and new to Julia - let me know if there is not enough information.

I have a Julia script that runs fine when I call it from the Julia REPL _include(“Run\_test.jl”)_. It takes some inputs from csv and other files, does some analysis, and saves results in new csv files. It doesn’t return anything (as far as I can tell), only prints messages in the terminal.

I’d like to call _Run\_test.jl_ from Python. Reason is that I have an interactive program in Python. User inputs that are collected in Python would be saved to a csv file which is then read by _Run\_test.jl_

I get an error message for the line marked below in _Run\_test.jl_ when I call it from _run.py_. I don’t understand why there is an error message because I am not returning anything from Julia to Python

_julenv.jl_ activates an environment and adds packages - no issues here.

_run.py_

```julia
from julia import Main       

Main.include("julenv.jl") 
Main.include("Run_test.jl")

```

_Run\_test.jl_

```julia
# .. other code ...

inpath = "folder_path"
mysetup = Dict()
# add key:value pairs to mysetup
myinputs=Dict()
myinputs = load_inputs(mysetup,inpath) #error message points here

# .. more code ...

```

Error message:

```julia
ImportError: <PyCall.jlwrap (in a Julia function called from Python)
JULIA: LoadError: LoadError: MethodError: Cannot `convert` an object of type Bool to an object of type String

```

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [May 10, 2021, 9:35pm UTC](https://discourse.julialang.org/t/julia-script-works-but-methoderror-when-using-python-pyjulia/60915/2 "2021-05-10T21:35:56Z")

</div>

Welcome!

As you suspected, this probably isn’t enough information to help you. At the very least can you show the full error message (including stack trace)? Even with that, it may be hard to figure out what’s going on without seeing the code that’s failing. Can you share whatever the actual function throwing the error is?
