Python Scope: The specified Python path is not valid: C:\Users\LENOVO\AppData\Local\Microsoft\WindowsApps\python

Python Scope: The specified Python path is not valid: C:\Users\LENOVO\AppData\Local\Microsoft\WindowsApps\python

Open cmd prompt and type “where python” to get the path

1 Like

Hi @Ejaz_Ab

Open Command Prompt and run : where python or where python3
In UiPath- python scope, set the path property to that real python.exe
make sure the pythonversion property matches your insalled version ex: python37, python38,etc.

Thanks

@Ejaz_Ab Please refer the UiPath document for python scope for better help.
Where I found below details

Path - The path to the Python environment installation folder (for example, "C:\Users\<User Name>\AppData\Local\Programs\Python\Python<version>"). This field supports only strings and String variables.

Activities - Python Scope

This error happens because the path provided is not a valid Python installation directory. Ensure Python is properly installed and set the path to the actual python.exe (e.g., C:\Python39\python.exe ). Update the Python Scope activity with the correct executable path.

Or if you are using only the folder path use C:\Users\LENOVO\AppData\Local\Microsoft\WindowsApps\python\ one extra \ forward slash

@Ejaz_Ab,

The root cause of the error is that the Python Scope isn’t configured properly.

Follow this how to guide for the right way to use the activities.

Hi @Ejaz_Ab

Install Python from python.org, then in UiPath Python Scope, set PythonPath to the full path of python.exe (not the WindowsApps path). You can find it by running “where python” in command prompt.

1 Like

applied all method which you people told me but still same issue i am facing

@Ejaz_Ab
You can watch this short YouTube tutorial that demonstrates how to set the Python path.

@Ejaz_Ab Are you still facing the error?

1 Like

when i find location after that i face this issue to find exe of python

Python Scope: Error initializing Python engine
now everything fine got this error

Yes @Ejaz_Ab

Are you using a company machine? If yes, please check with your system admin to fix the installation issue. It might be restricted by company policy.
Then check again like this.

Happy Automation

no its my own machine

Ok then try to Right-click on the installer file and select “Run as administrator.” This grants the installer the necessary permissions to make system-level changes.

This happen due to windows security.

Is UiPath supoort python version which is greater then 3.10

Hi @Ejaz_Ab , please save your code to .py file and run it using PowerShell command. it’s very effective and use can use the python version that has been set up in your environment variable.

i want to do it from python activities not from powershell

“C:\Users\LENOVO\AppData\Local\Programs\Python\Python313\python313.dll” “C:\Users\LENOVO\AppData\Local\Programs\Python\Python313”

error is Python Scope: Error initializing Python engine