Python-Scope-Fehler – „Der angegebene Python-Pfad ist ungültig“, auch nach einer Neuinstallation

Hallo zusammen,

ich arbeite gerade an einem Automatisierungsprojekt in UiPath Studio (Community Edition), bei dem ein Python-Skript über die Aktivität Python Scope ausgeführt werden muss. Allerdings erhalte ich immer wieder die folgende Fehlermeldung:

Python Scope: The specified Python path is not valid: C:\Program Files\Python39\python.exe

Folgendes habe ich bereits versucht:

  • Mehrere Python-Versionen (3.10, 3.12, 3.9) installiert und neu installiert, alle in der 64-Bit-Version
  • Überprüft, ob sich python.exe manuell über den angegebenen Pfad öffnen lässt
  • Den Python-Pfad in UiPath genau wie im Installationsverzeichnis angegeben eingetragen
  • UiPath und meinen Laptop neu gestartet
  • Sichergegangen, dass Python zum PATH hinzugefügt wurde und pip funktioniert
  • Ein einfaches Skript erstellt, das in VS Code oder im Terminal funktioniert

Trotz alledem erkennt die Aktivität Python Scope den Python-Pfad weiterhin nicht.

:light_bulb: Ich benötige Python Scope, um ein Prophet-Zeitreihenprognose-Skript auszuführen, das Transaktionen von Kunden für 2025 vorhersagt. Die Ergebnisse möchte ich in den restlichen Automatisierungsablauf in UiPath integrieren.

Für jede Hilfe wäre ich sehr dankbar. Vielen Dank im Voraus!

Hi @nashwasabila11

Please have a look at this sample:

There is a sample project at the bottom of the page with a sample configuration. Could you please double-check your configuration against this sample ?

@nashwasabila11

are you providing the apth to exe or the folder containing exe? you need to only pass till the folder

cheers

Thanks a lot for your help! :folded_hands:
The path issue is now resolved after I updated it as you suggested. :blush:

However, I’m now getting a new error:
“Python Scope: Error initializing Python engine”

Looks like it’s a different issue — maybe related to the Python version or environment. I’ll dig into it a bit more and see what I can find.

Really appreciate your support! :raising_hands:

@nashwasabila11

glad it is resolved

try to check the event viewer log it might show the error can be related to .net runtime version

cheers

Thank you so much for your attention and support — really appreciate it! :folded_hands:
I’ll definitely take a closer look at the sample project and compare it with my current configuration.

Thanks again for guiding me through this! :blush:

Hi again, thanks for the previous help — I initially thought it was resolved, but I’m still facing an issue.

I did what you suggested:

  • I opened Event Viewer
  • I downloaded and installed the appropriate .NET Runtime as needed

However, now when I try to run the workflow, I’m getting this error again:

“Invoke Python Method: One or more errors occurred. (Error invoking Python method)”

Just to confirm:

  • I’m loading the Python script via Load Python Script with the File path , and leaving the Code field empty
  • Using Python 3.X with pandas installed
  • The Python function returns a pandas DataFrame — could that be causing an issue?

I’m wondering if this is still related to the .NET Runtime or maybe how the return value is handled?

Any ideas would be greatly appreciated — thank you again!

@nashwasabila11

  1. Open the exception detaila from locals pane by running in debug mode to check the full error that might give correct issue
  2. First try to run a simple python script with no imports and simple code like addition of number or so to check if setup is proper
  3. As per error looks like the return or import is failing ..import might fail if library path is not provided or if there are multiple instances of python

Cheers

Thanks for your help! Really appreciate you taking the time to guide me — it worked in the end!