❔ [FIX} Csharp & Python / WPF APP
I have a problem with this code, in fact I have a button on my WPF software and when I click on it it executes a separate python script in another file.
The problem is that the software returns me my error I made in "Try" and tells me that it can't find the file and it can't run it, yet I don't understand the path is ok , can someone help me?
33 Replies
If it says the file does not exist it probably really does not exist. Are you sure the path is right? If you open a PowerShell window and type this what does it say?
I don't see any reason that code would fail then
why not just call "python"?
it will work if you have the language properly installed in your OS
since you have the path environment variable enabled
What?
Your error message is supposed to say this:
| Le fichier de script n'existe pas
But the error message you just showed does not say that.
So is that error message coming from somewhere else?
yeah your program cant find python maybe?
try only using "python"
instead of the path
just curious if itll work
Just python, how?
instead of passing the python path
just type python [script path]
I'm not very strong in Csharp lmao, how?
are you instancing a new Process?
to execute the script?
can you show that part of the code?
No
put breakpoints in your errors
your screenshot dont fit with the code you are showing
As I said, you are instancing a new Process
can you show the entire code?
Is your Python path really correct?
I mean, your script path is correct
Mhm
but how about the Python exe ?
Oh script path?
no
you are using the wrong python path
Oh
check the screenshot you sent now and check your code
Okay, Now I don't have the same code anymore depending on the 2 locations I put
wait
With: C:\Users\Cooky\AppData\Local\Programs\Python\Python311\python.exe
With: C:\Users\Cooky\AppData\Local\Microsoft\WindowsApps\python.exe
"Script exited with error code"
Mhmmm 🤔
My script works perfectly locally, why not from here?
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.