title: Julia Calling Python Function
body: <p>I've been trying to call python functions from Julia using this code:</p>
  
  <pre><code>using PyCall
  unshift!(PyVector(pyimport("sys")["path"]), "")
  @pyimport testing
  print(testing.add())
  </code></pre>
  
  <p>testing is in the same path. </p>
  
  <p>the testing python file:</p>
  
  <pre><code>def add():
      return 5 + 5
  </code></pre>
  
  <p>I am getting this error from Julia though: </p>
  
  <pre><code>LoadError: PyError (ccall(@pysym(:PyImport_ImportModule), PyPtr, (Cstring,), 
  name)) &lt;class 'ImportError'&gt; ImportError("No module named 'testing'",)
  
  while loading C:\Users\Benjamin\AppData\Local\JuliaPro-0.6.0.1\test.jl, in expression starting on line 410
  pyerr_check at exception.jl:56 [inlined]
  pyerr_check at exception.jl:61 [inlined]
  macro expansion at exception.jl:81 [inlined]
  pyimport(::String) at PyCall.jl:370
  include_string(::String, ::String) at loading.jl:515
  include_string(::Module, ::String, ::String) at Compat.jl:577
  (::Atom.##55#58{String,String})() at eval.jl:73
  withpath(::Atom.##55#58{String,String}, ::String) at utils.jl:30
  withpath(::Function, ::String) at eval.jl:38
  macro expansion at eval.jl:71 [inlined]
  (::Atom.##54#57{Dict{String,Any}})() at task.jl:80
  </code></pre>
  
  <p>How can I fix this?</p>
  
  <p>Also how can I do this:
  (Julia):</p>
  
  <pre><code>using PyCall
  unshift!(PyVector(pyimport("sys")["path"]), "")
  @pyimport testing
  print(testing.add(5, 5))
  </code></pre>
  
  <p>(Python):</p>
  
  <pre><code>def add(a, b):
      return a + b
  </code></pre>