# Error in the Python Scope Activity

**URL:** <https://forum.uipath.com/t/error-in-the-python-scope-activity/739106>\
**Category:** Studio\
**Tags:** activities-panel, question, studio, python, activities\
**Created:** [May 6, 2024, 2:14pm UTC](https://forum.uipath.com/t/error-in-the-python-scope-activity/739106 "2024-05-06T14:14:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![didac.elgueta](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@didac.elgueta](https://forum.uipath.com/u/didac.elgueta)\
**Post date:** [May 6, 2024, 2:14pm UTC](https://forum.uipath.com/t/error-in-the-python-scope-activity/739106/1 "2024-05-06T14:14:28Z")

</div>

I want to run a run a function in a python script. The script is really simple and has no errors.  
**UiPath Studio** : 2023.10.6  
**UiPath.Python.Activities** : 1.8.1

The error is the following: Python Scope: The specified Python path is not valid: C:\Users\*\*\*\*\*\*\*\AppData\Local\Programs\Python\Python311\python.exe

This are the Python Scope properties:

 ![image](https://global.discourse-cdn.com/uipath/original/4X/d/d/0/dd06448a04e254628f4eaf2d990fda724865888f.png)

If I run **where python** I have the following:  
C:\Users\*\*\*\*\*\*\*\AppData\Local\Programs\Python\Python311\python.exe

I searched for solution in the Forum but after trying all the possible solutions I am still blocked.

Thanks in advance for your help.

---

<div class="post-metadata">

**Author:** ![Anil\_G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anil_g/32/524291_2.png) [@Anil\_G](https://forum.uipath.com/u/Anil_G)\
**Post date:** [May 6, 2024, 2:20pm UTC](https://forum.uipath.com/t/error-in-the-python-scope-activity/739106/2 "2024-05-06T14:20:43Z")

</div>

@didac.elgueta

Can you give the library path as well and check…

Also in the path give only till python311…python.exe is not needed

 ![IMG_7245](https://global.discourse-cdn.com/uipath/original/4X/7/e/5/7e57207093a818e10759d01028b4912681236685.jpeg)

Cheers

---

<div class="post-metadata">

**Author:** ![didac.elgueta](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@didac.elgueta](https://forum.uipath.com/u/didac.elgueta)\
**Post date:** [May 6, 2024, 2:35pm UTC](https://forum.uipath.com/t/error-in-the-python-scope-activity/739106/3 "2024-05-06T14:35:35Z")

</div>

Hi @Anil_G

Thanks for your reply. I have removed the python.exe in the Path property and I have added the property Library Path.

Now I don’t get the error but the execution is stuck.

 ![image](https://global.discourse-cdn.com/uipath/original/4X/d/2/1/d215df69096d685f65353f72393c89655da57760.png)

---

<div class="post-metadata">

**Author:** ![ashokkarale](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ashokkarale/32/474400_2.png) [@ashokkarale](https://forum.uipath.com/u/ashokkarale)\
**Post date:** [May 6, 2024, 3:07pm UTC](https://forum.uipath.com/t/error-in-the-python-scope-activity/739106/4 "2024-05-06T15:07:59Z")

</div>

@didac.elguet,

Try running this sample code.

You should have .Net runtime 6.0 installed and the Python exe path added to System variable.

[Main.xaml](https://forum.uipath.com/uploads/short-url/qqyToRs0qgvMGNovh61QjCXfBL9.xaml) (8.3 KB)

Thanks,  
Ashok 🙂

---

<div class="post-metadata">

**Author:** ![Anil\_G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anil_g/32/524291_2.png) [@Anil\_G](https://forum.uipath.com/u/Anil_G)\
**Post date:** [May 6, 2024, 3:25pm UTC](https://forum.uipath.com/t/error-in-the-python-scope-activity/739106/5 "2024-05-06T15:25:59Z")

</div>

@didac.elgueta

.net 5.0+ runtime is needed for python to run

Also to confirm error check eventviewer logs

Cheers

---

<div class="post-metadata">

**Author:** ![didac.elgueta](https://avatars.discourse-cdn.com/v4/letter/d/b487fb/32.png) [@didac.elgueta](https://forum.uipath.com/u/didac.elgueta)\
**Post date:** [May 6, 2024, 3:39pm UTC](https://forum.uipath.com/t/error-in-the-python-scope-activity/739106/6 "2024-05-06T15:39:49Z")

</div>

Hi @ashokkarale

Thanks for your reply. I needed to install .NET 6.0

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [May 9, 2024, 3:40pm UTC](https://forum.uipath.com/t/error-in-the-python-scope-activity/739106/7 "2024-05-09T15:40:06Z")

</div>

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