Python Scope Error – "The specified Python path is not valid" even after reinstalling

Hi everyone,

I’m currently working on an automation project in UiPath Studio (Community Edition) that requires running a Python script via the Python Scope activity. However, I keep getting the following error:

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

Here’s what I’ve tried so far:

  • Installed and reinstalled multiple Python versions (3.10, 3.12, 3.9), all 64-bit versions
  • Verified that python.exe can be opened manually from the path
  • Set the Python path in UiPath exactly as shown in the installed directory
  • Restarted UiPath and my laptop
  • Made sure Python is added to PATH and that pip works
  • Created a simple script that works when run from VS Code or terminal

Despite all this, the Python Scope activity still doesn’t recognize the Python path.

:light_bulb: I need Python Scope to run a Prophet time series forecasting script for predicting client transactions in 2025, and I plan to integrate the output with the rest of the automation flow in UiPath.

Any help would be greatly appreciated. Thank you in advance!

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:

1 Like

@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!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.