Python Scope uipath version and python version compatibility issue

I have requirement to use python scope activity. I have installed python 3.10 and UiPath.python.activities package as 1.8.1 and most recent 1.9.0-alpha as well. It shows the below error.

e
Is there anyway to achieve this in 32-bit? If yes Please mention required versions.

@vinoth4390

Welcome to the community

As per error if you install any version •less than 3.10 then 32 bit is supported else you need to install 64 bit

Cheers

I know this is an old topic, but I’m hoping I can still get some attention, as I’m seeing the same issue.

Further, I have Python 3.11 and 3.12 installed. I’ve tried running under both, getting the same error in each case.

When I invoke “python” I see:
$ python
Python 3.11.2 (tags/v3.11.2:878ead1, Feb 7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> exit()

3.12 has similar output.

Any suggestions on getting around this? I’m just trying to implement UiPath’s example for using a Python Scope and Method: Activities - Invoking a Python Script

Hi, I faced a similar issue when working with the Python Scope and Invoke Python Method activities. The problem is likely due to the Python version you’re using.

UiPath currently supports Python versions 3.6 to 3.10 only. Since you’re using Python 3.11 and 3.12, this could be causing the integration error.

Here’s what worked for me:

  1. I uninstalled the newer versions and installed Python 3.10 (64-bit) from the official site: Python Release Python 3.10.0 | Python.org
  2. During installation, I made sure to check “Add Python to PATH.”
  3. In the Python Scope activity, I selected “Specify path manually” and pointed it to the Python 3.10 executable.
  4. After that, I was able to successfully load and invoke functions from my Python script using UiPath.

Hope this helps! Let me know if you need a working example script.

Can you try in a Windows project (64-bit)?
Can you check to have in the Path environment variables only the 64-bit path of the python.exe?
How did you configure the Python Scope activity?
Which are the result for where python in a cmd.exe console?

Thanks for your reply!

I only have Python 3.11 in my PATH. My 3.11 installation is 64 bit, as I posted above. I’m building the project in UiPath Studio v2025.0.166 STS, which does not have “64 bit” as an option for new projects. Compatibility is set to “Windows”, and the language is set to “C#”.

I’m trying to recreate the UiPath demo showing how to use the Python activities, as posted above. As such, the Python Scope is configured as:

Library path: “C:\Users\name\AppData\Local\Programs\Python\Python311”
Path: (a variable containing the library path with “Python311” appended to it).
Target: x86

The above configuration yields the error I reported above (essentially a version mismatch error). If I set the “Target” to “x64” I get the error:

“$ where python” (in cmd shell) yields:

C:\Users\name\AppData\Local\Programs\Python\Python311\python.exe
C:\Users\name\AppData\Local\Microsoft\WindowsApps\python.exe

Attempting to execute the second python.exe brings up a GUI installer trying to locate it on the Windows App Store, which is blocked by my organization.

Thanks very much for your reply. This is likely the cause of the issue. While I’m not terribly surprised, I am disappointed. My company really doesn’t like using old versions of software.

Use UiPath.Python.Activities.1.10.0

Configure the Python Scope as below:

Library path: "C:\Users\your_username\AppData\Local\Programs\Python\Python311\python311.dll"
Path: "C:\Users\your_username\AppData\Local\Programs\Python\Python311"
Target: x64
Version: Python >=3.10

In below case is for Python.3.13.3 and it worked.

Thank you very much, Marian! That got me a bit farther. It’s still failing (now can’t find the method within the Python class) but you’ve got me on the right track.

1 Like

Cannot find method from the class is from Python code itself or maybe UiPath cannot load your library.
Test without UiPath and check if you can replicate the same.

Try to import libraries as below in your Python code at the beginning:

try:
    sys.path.append(os.path.dirname(os.path.realpath(__file__)))
    import pytesseract
    from PIL import Image
except Exception as e:
    #print(f"Error during imports: {e}")
    raise

Reference: Activities - Load Python Script

Example:

import sys
import os

try:
    sys.path.append(os.path.dirname(os.path.realpath(__file__)))
    import pytesseract
    from PIL import Image
except Exception as e:
    #print(f"Error during imports: {e}")
    raise

# Set the tesseract executable path
pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"

def rotate_and_correct_image(In_FilePath):
    try:
        In_OutputPath = In_FilePath
        original_image = Image.open(In_FilePath)
        osd = pytesseract.image_to_osd(original_image)
        #print("OSD Data:", osd)  # Debug print
        rotation_angle = int([line.split(":")[1].strip() for line in osd.split("\n") if "Rotate" in line][0])
        #print("Rotation Angle:", rotation_angle)  # Debug print
        corrected_image = original_image.rotate(-rotation_angle, expand=True)
        corrected_image.save(In_OutputPath)
        return In_OutputPath  # Return the output file path
    except Exception as e:
        return f"Error during image processing: {e}"

Thanks! I’m now able to call Python methods.