# A issue to use PythonCall to call a Simple Python File Of WxPython Hello World

**URL:** <https://discourse.julialang.org/t/a-issue-to-use-pythoncall-to-call-a-simple-python-file-of-wxpython-hello-world/136567>\
**Category:** New to Julia\
**Created:** [April 5, 2026, 1:41am UTC](https://discourse.julialang.org/t/a-issue-to-use-pythoncall-to-call-a-simple-python-file-of-wxpython-hello-world/136567 "2026-04-05T01:41:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![aldo](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@aldo](https://discourse.julialang.org/u/aldo)\
**Post date:** [April 5, 2026, 1:41am UTC](https://discourse.julialang.org/t/a-issue-to-use-pythoncall-to-call-a-simple-python-file-of-wxpython-hello-world/136567/1 "2026-04-05T01:41:14Z")

</div>

Hello, I am new to Julia and just start to learn it this week. I got a problem to use PythonCall to call a Simple Python File Of WxPython Hello World. My Julia code and Python code are below. When I ran Julia code the below an error came out, I have searched online and tried many ways, but no luck. It looks like it can not find python.exe, but I am sure it is under the folder “C:\Python-3.12\python.exe”. is there a way to fix it? Thanks a lot! I appreciate it.

```julia-auto
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases.
ERROR: failed process: Process(`python 'C:\JuliaTryOut\Test01.py'`, ProcessExited(9009)) [9009]

Stacktrace:
 [1] pipeline_error
   @ .\process.jl:597 [inlined]
 [2] run(::Cmd; wait::Bool)
   @ Base .\process.jl:512
 [3] run(::Cmd)
   @ Base .\process.jl:509
 [4] top-level scope
   @ c:\JuliaTryOut\Test01.jl:18

```

-------------------My Julia Code---------------------------------------------------------

```julia-auto
 ENV["JULIA_CONDAPKG_BACKEND"] = "Null";

 ENV["JULIA_PYTHONCALL_EXE"] = "C:\\Python-3.12\\python.exe"

 using PythonCall

 pyimport("sys").path.append(pwd())

 println(PythonCall.C.CTX.exe_path)

 #pyexec(read("Test01.py", String));

 run(`python C:\\JuliaTryOut\\Test01.py`)

```

-------------------My Python File Test01.py-------------------------------------------------------------

```py
import wx

class MyFrame(wx.Frame):
    def __init__ (self):
        # Initialize the parent class (wx.Frame)
        super(). __init__ (parent=None, title='Hello World', size=(300, 200))

        # Add a panel to the frame for better layout management
        panel = wx.Panel(self)

        # Add static text to the panel
        self.text = wx.StaticText(panel, label="Hello, wxPython!", pos=(100, 70))

if __name__ == ' __main__':
    # 1. Initialize the Application
    app = wx.App()

    # 2. Create and show the main frame
    frame = MyFrame()
    frame.Show()

    # 3. Start the main event loop
    app.MainLoop()

```

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [April 5, 2026, 3:24am UTC](https://discourse.julialang.org/t/a-issue-to-use-pythoncall-to-call-a-simple-python-file-of-wxpython-hello-world/136567/2 "2026-04-05T03:24:49Z")

</div>

Hello,

Welcome to the community!

Can you please enclose the code and the error message in your message in triple backticks, like ``` ?

That makes it easier to read.

---

<div class="post-metadata">

**Author:** ![aldo](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@aldo](https://discourse.julialang.org/u/aldo)\
**Post date:** [April 5, 2026, 3:54am UTC](https://discourse.julialang.org/t/a-issue-to-use-pythoncall-to-call-a-simple-python-file-of-wxpython-hello-world/136567/3 "2026-04-05T03:54:20Z")

</div>

ufechner7, is the below format one you want?

-------------------Error Message---------------------------------------------------------  
‘’’  
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings \> Apps \> Advanced app settings \> App execution aliases.  
ERROR: failed process: Process(`python 'C:\JuliaTryOut\Test01.py'`, ProcessExited(9009)) [9009]

Stacktrace:  
[1] pipeline\_error  
@ .\process.jl:597 [inlined]  
[2] run(::Cmd; wait::Bool)  
@ Base .\process.jl:512  
[3] run(::Cmd)  
@ Base .\process.jl:509  
[4] top-level scope  
@ c:\JuliaTryOut\Test01.jl:18  
‘’’

-------------------My Julia Code---------------------------------------------------------  
‘’’  
ENV[“JULIA\_CONDAPKG\_BACKEND”] = “Null”;

ENV[“JULIA\_PYTHONCALL\_EXE”] = “C:\Python-3.12\python.exe”

using PythonCall

pyimport(“sys”).path.append(pwd())

println(PythonCall.C.CTX.exe\_path)

#pyexec(read(“Test01.py”, String));

run(`python C:\\JuliaTryOut\\Test01.py`)  
‘’’

-------------------My Python File Test01.py-------------------------------------------------------------  
‘’’  
import wx

class MyFrame(wx.Frame):  
def **init** (self):  
# Initialize the parent class (wx.Frame)  
super(). **init** (parent=None, title=‘Hello World’, size=(300, 200))

```
    # Add a panel to the frame for better layout management
    panel = wx.Panel(self)

    # Add static text to the panel
    self.text = wx.StaticText(panel, label="Hello, wxPython!", pos=(100, 70))

```

if **name** == ‘ **main** ’:  
# 1. Initialize the Application  
app = wx.App()

```
# 2. Create and show the main frame
frame = MyFrame()
frame.Show()

# 3. Start the main event loop
app.MainLoop()

```

‘’’

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [April 5, 2026, 4:07am UTC](https://discourse.julialang.org/t/a-issue-to-use-pythoncall-to-call-a-simple-python-file-of-wxpython-hello-world/136567/4 "2026-04-05T04:07:00Z")

</div>

> [@aldo](#):
>
> ‘’’

Sorry, you are not there yet.

Firstly, you can edit your post. Better than creating a new post.

Secondly, you used three **right single quotation marks** (U+2019, often called curly or typographic apostrophes). Backticks (`), by contrast, are straight grave accents (U+0060) used in computing for code blocks, template literals, and command substitution.

Try to copy-and-paste the backticks from my post if you cannot find them on your keyboard: ```

See also: [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757)

---

<div class="post-metadata">

**Author:** ![eldee](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@eldee](https://discourse.julialang.org/u/eldee)\
**Post date:** [April 5, 2026, 7:55am UTC](https://discourse.julialang.org/t/a-issue-to-use-pythoncall-to-call-a-simple-python-file-of-wxpython-hello-world/136567/5 "2026-04-05T07:55:53Z")

</div>

> [@aldo](#):
>
> Python was not found

It sounds like Python is not on your PATH. You could simply add it:

- Permanently, e.g. via these instructions: [How do I set or change the PATH system variable?](https://www.java.com/en/download/help/path.html)
- Temporarily, in Julia:

```julia-auto
ENV["PATH"] = "C:\\Python-3.12;" * ENV["PATH"]

```

(note the `;`).

Now your

```julia-auto
run(`python C:\\JuliaTryOut\\Test01.py`)

```

should work. You can also avoid messing with `PATH` entirely by just providing the complete Python path:

```julia-auto
run(`C:\\Python-3.12\\python.exe C:\\JuliaTryOut\\Test01.py`)

```

* * *

Note that we have not used PythonCall.jl here. If you just want to run a Python script, but not really interact with it, you really don’t need this package. But you could (probably) use

```julia-auto
pyexec(read("C:\\JuliaTryOut\\Test01.py", String), Main) 

```

or

```julia-auto
pyexec(read("C:\\JuliaTryOut\\Test01.py", String), PyDict())

```

If `pwd() == “C:\\JuliaTryOut\\"`, as is presumably the case, you can just use `"Test01.py"`. Compared to what you had commented out, you then just needed the second argument.

---

<div class="post-metadata">

**Author:** ![lilachint](https://avatars.discourse-cdn.com/v4/letter/l/ee7513/32.png) [@lilachint](https://discourse.julialang.org/u/lilachint)\
**Post date:** [April 5, 2026, 8:07am UTC](https://discourse.julialang.org/t/a-issue-to-use-pythoncall-to-call-a-simple-python-file-of-wxpython-hello-world/136567/6 "2026-04-05T08:07:09Z")

</div>

When using Windows, path delimiters should either be escaped `"C:\\Python-3.12\\python.exe"` or you could use `raw` strings: `raw"C:\python-3.12\python.exe"`.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [April 5, 2026, 11:17am UTC](https://discourse.julialang.org/t/a-issue-to-use-pythoncall-to-call-a-simple-python-file-of-wxpython-hello-world/136567/7 "2026-04-05T11:17:42Z")

</div>

> `Python was not found; run without arguments to install from the Microsoft Store`

This error says you didn’t install Python properly. — your `python.exe` exists but is an alias that doesn’t do anything except install Python if you run it without arguments.

Have you tried running Python from the command line, without using Julia?

> When using Windows, path delimiters should either be escaped

The OP was already doing this, but because they weren’t quoting their code, the escapes weren’t showing up. I edited the post to quote the code correctly so that you can now read the escapes.

> [@ufechner7](#):
>
> Secondly, you used three **right single quotation marks** (U+2019, often called curly or typographic apostrophes).

Actually the OP used three apostrophes `'` (U+0027) — it’s just that discourse automatically displays those as curly quotes. But your point stands that what is needed is three [backticks](https://en.wikipedia.org/wiki/Backtick) ```.

This post talks specifically about quoting: [PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530)

---

<div class="post-metadata">

**Author:** ![aldo](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@aldo](https://discourse.julialang.org/u/aldo)\
**Post date:** [April 5, 2026, 6:41pm UTC](https://discourse.julialang.org/t/a-issue-to-use-pythoncall-to-call-a-simple-python-file-of-wxpython-hello-world/136567/8 "2026-04-05T18:41:38Z")

</div>

eldee and others,  
Thanks a lot for the clues. I followed eldee’s advice to add ENV[“PATH”] = “C:\Python-3.12;” \* ENV[“PATH”]. That fixed the problem. I appreciate everyone’s assistance.

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [April 6, 2026, 1:59am UTC](https://discourse.julialang.org/t/a-issue-to-use-pythoncall-to-call-a-simple-python-file-of-wxpython-hello-world/136567/9 "2026-04-06T01:59:33Z")

</div>

The formatting advice here is part of Discourse’s Markdown parsing. Markdown isn’t exactly standardized in the sense that different places implement different extensions, but the basics should get most of the job done, and the interactive icons on Discourse post editors help.

[Formatting posts using markdown, BBCode, and HTML - Documentation / Using Discourse - Discourse Meta](https://meta.discourse.org/t/formatting-posts-using-markdown-bbcode-and-html/239348)

Taking a few minutes to learn the basics is worth the clarity to readers, and Markdown is lightweight enough to be readable where there is no Markdown rendering.

> [@aldo](#):
>
> ```julia-auto
> ENV["JULIA_CONDAPKG_BACKEND"] = "Null";
> 
> ENV["JULIA_PYTHONCALL_EXE"] = "C:\\Python-3.12\\python.exe"
> 
> ```

Although the issue was resolved by changing `ENV["PATH"]`, these lines are [a documented alternative](https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-Python-and-required-Python-packages-installed) to having the `python` executable on the path. You can track down the `python` executable path in the global Python install or a virtual environment. I personally recommend defaulting to `PythonCall` using `CondaPkg` for a Julia-first project, but these alternatives are good for adding Julia to existing Python projects.
