The specified Python path is not valid in uipath

Hello, I’m getting the above error when trying to run python script in studio. Below are my specs:

  • studio version 2023.4.7
  • python package 1.8.2
  • python version 3.11.5

i tried to use the forum’s other posts with no success. Here’s what i’ve done:

  • i’ve put both file path’s into the python scope. both have given me the same error
  • i’ve tried right clicking the program to find folder location and get different path from cmd but that doesn’t work either. C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Python 3.11
  • i’ve tried leaving off “python.exe” as suggested in another forum and when i run file, nothing happens at all. studio freezes

Hi @chris.dease

You might have to use the official Python installer rather than its Windows store version. The library path is supposed to point to the python311.dll file, and I don’t think there is one for this installation method.

@chris.dease

Refer this how to guide.

If still don’t work, share how you are configuring

this is how i set it up:
localAppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)

pythonPath = localAppDataPath + "\Programs\Python\Python311"

pythonLibraryPath = localAppDataPath + “\Programs\Python\Python312\python311.dll”

received the log message: The installation path of Python 3.12 was set as: C:\Users\ACI43\AppData\Local\Programs\Python\Python311\

still received the error.

Verified python does work by running script outside of UiPath

@chris.dease,

Have you set enviornment variable for python?

Have you tried the sample code from this?

Hey @chris.dease

Just a sanity check, in case you copy pasted the content above. Please note the discrepancy:

i did use 311. i just copied the log message from the documentation

i changed from 312 to 311 and still same result

i’m not running this exact script. i’m running one i have from youtube. same scenario though. but debug won’t even let me get to the script. it’s failing at python scope.

@chris.dease,

Get the sample code from the documentation first to isolate the issue you have. Once the code from here works then you can try other scripts to run.

i downloaded the entire sample workflow and changed the 312 to 311 in the code. Still getting the same issue.

@chris.dease,

Try removing that last \ from the path.

same issue.
image

Hi @chris.dease

Copy this path & try to open it in the run. Is it correclty pointing to the Python path.
Also try to hardcode the path insted of varible. For testing.

are you telling me to copy and paste what i put in my screenshot instead of passing the variable?

Yes correct. Don’t pass it as variable.

i used both C:\Users\ACI43\AppData\Local\Programs\Python\Python311\ and C:\Users\ACI43\AppData\Local\Programs\Python\Python311 as the path and got the same results.

hard coded library path to “C:\Users\ACI43\AppData\Local\Programs\Python\Python311\python311.dll”

Check python is installed correctly or not in cmd. Also your python version should match your system like 32 bit or 64bit.

I’m not sure what you’re asking by checking if python is installed correctly but I was able to run the script outside of Studio with success.

i did do the following based on a youtube video and the results were no error but also no output. the automation would not move forward or would never stop.

the video told me to right click on python icon and get folder location. i got back C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Python 3.11. when i added that path, i got the issue in the bold.

also confirmed it’s 64-bit and i have that configured in studio.

I think when you followed the youtube video & there was no error & bot was not moving ahead you were on right track.

You also need to install .net 6.0 version for python scope to work