# Python Scope

**URL:** <https://forum.uipath.com/t/python-scope/469978>\
**Category:** Community\
**Tags:** community, question, studio, python, forum, activities\
**Created:** [September 2, 2022, 11:49am UTC](https://forum.uipath.com/t/python-scope/469978 "2022-09-02T11:49:45Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sukanya\_Dutta](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sukanya_dutta/32/319907_2.png) [@Sukanya\_Dutta](https://forum.uipath.com/u/Sukanya_Dutta)\
**Post date:** [September 2, 2022, 11:49am UTC](https://forum.uipath.com/t/python-scope/469978/1 "2022-09-02T11:49:45Z")

</div>

I got this error → Python Scope: Error initializing Python engine

---

<div class="post-metadata">

**Author:** ![Gokul001](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokul001/32/462734_2.png) [@Gokul001](https://forum.uipath.com/u/Gokul001)\
**Post date:** [September 2, 2022, 11:52am UTC](https://forum.uipath.com/t/python-scope/469978/2 "2022-09-02T11:52:04Z")

</div>

Hi @Sukanya_Dutta

Have a look on the Tutorial

> [@Integrating Python script for Encrypt and Decrypt](https://forum.uipath.com/t/integrating-python-script-for-encrypt-and-decrypt/461503):
>
> Hello Guys, I would like to present this tutorial who are looking for Encrypt and Decrypt in Python. Refer the thread to install Python : [Python installation and Pip Installation](https://forum.uipath.com/t/python-installation-and-pip-installation/461504) Following steps that need to Encrypt and Decrypt Install “Uipath.Pyton.Activities” [image] Python Process always work Within in Python scope. Drag and drop the “Python Scope” 3.1. Python Scope Property → Input\>Path- Need to provide the installation path of Python application. 3.2. Target → Enter the Bit do…

Regards  
Gokul

---

<div class="post-metadata">

**Author:** ![Gokul\_Jayakumar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokul_jayakumar/32/425938_2.png) [@Gokul\_Jayakumar](https://forum.uipath.com/u/Gokul_Jayakumar)\
**Post date:** [September 2, 2022, 12:08pm UTC](https://forum.uipath.com/t/python-scope/469978/3 "2022-09-02T12:08:45Z")

</div>

> [@Sukanya\_Dutta](#):
>
> Python Scope: Error initializing Python engine

Hello @Sukanya_Dutta , Check your python version and the UiPath pyton activiy was in updated

---

<div class="post-metadata">

**Author:** ![Sukanya\_Dutta](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sukanya_dutta/32/319907_2.png) [@Sukanya\_Dutta](https://forum.uipath.com/u/Sukanya_Dutta)\
**Post date:** [September 2, 2022, 12:18pm UTC](https://forum.uipath.com/t/python-scope/469978/4 "2022-09-02T12:18:50Z")

</div>

Python version is 3.6

---

<div class="post-metadata">

**Author:** ![Gokul\_Jayakumar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokul_jayakumar/32/425938_2.png) [@Gokul\_Jayakumar](https://forum.uipath.com/u/Gokul_Jayakumar)\
**Post date:** [September 2, 2022, 12:32pm UTC](https://forum.uipath.com/t/python-scope/469978/5 "2022-09-02T12:32:44Z")

</div>

@Sukanya_Dutta , Did you add your python path in System Environment variables?  
 ![image](https://global.discourse-cdn.com/uipath/original/4X/0/1/e/01e2274807333a45c7a7b44b62f609b765a387b3.png)  
 ![image](https://global.discourse-cdn.com/uipath/original/4X/a/2/c/a2c5e530e3f85e15ef5825beb41338c6d09b3e3e.png)

---

<div class="post-metadata">

**Author:** ![Sukanya\_Dutta](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sukanya_dutta/32/319907_2.png) [@Sukanya\_Dutta](https://forum.uipath.com/u/Sukanya_Dutta)\
**Post date:** [September 2, 2022, 12:34pm UTC](https://forum.uipath.com/t/python-scope/469978/6 "2022-09-02T12:34:00Z")

</div>

Yes I have added

---

<div class="post-metadata">

**Author:** ![Gokul\_Jayakumar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokul_jayakumar/32/425938_2.png) [@Gokul\_Jayakumar](https://forum.uipath.com/u/Gokul_Jayakumar)\
**Post date:** [September 2, 2022, 12:41pm UTC](https://forum.uipath.com/t/python-scope/469978/7 "2022-09-02T12:41:41Z")

</div>

@Sukanya_Dutta , Also check the Python activity version in uipath  
 ![image](https://global.discourse-cdn.com/uipath/original/4X/c/0/d/c0d3264ce0547a0c5b22e6c100dedb4de3e61259.png)

---

<div class="post-metadata">

**Author:** ![Sukanya\_Dutta](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sukanya_dutta/32/319907_2.png) [@Sukanya\_Dutta](https://forum.uipath.com/u/Sukanya_Dutta)\
**Post date:** [September 2, 2022, 12:44pm UTC](https://forum.uipath.com/t/python-scope/469978/8 "2022-09-02T12:44:15Z")

</div>

![Untitled](https://global.discourse-cdn.com/uipath/original/4X/7/7/0/770b5967db3c52c7be3222139b9bf4d239bc256f.png)

---

<div class="post-metadata">

**Author:** ![Gokul\_Jayakumar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokul_jayakumar/32/425938_2.png) [@Gokul\_Jayakumar](https://forum.uipath.com/u/Gokul_Jayakumar)\
**Post date:** [September 2, 2022, 12:53pm UTC](https://forum.uipath.com/t/python-scope/469978/9 "2022-09-02T12:53:10Z")

</div>

@Sukanya_Dutta , I’m not sure about this, just upgrade your Python verson and install properly with pip installer and try again in uipath  
I’m using Python 3.8.10 , not facing any issues  
Download link: [https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe](https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe)  
Pip Installer steps: [pybase64 · PyPI](https://pypi.org/project/pybase64/)  
Kindly try this, it may work for you.

---

<div class="post-metadata">

**Author:** ![Gokul\_Jayakumar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gokul_jayakumar/32/425938_2.png) [@Gokul\_Jayakumar](https://forum.uipath.com/u/Gokul_Jayakumar)\
**Post date:** [September 2, 2022, 1:01pm UTC](https://forum.uipath.com/t/python-scope/469978/10 "2022-09-02T13:01:54Z")

</div>

@Sukanya_Dutta also check the Properties and data you have entered are cross check.

- Check the path of python
- select the Target
- Check the correct version
- check the Working Folder (Script Folder)  
 ![image](https://global.discourse-cdn.com/uipath/original/4X/e/f/e/efe2249caba40924f7eb30eed2e503a2a9321679.png)

---

<div class="post-metadata">

**Author:** ![marian.platonov](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/marian.platonov/32/260263_2.png) [@marian.platonov](https://forum.uipath.com/u/marian.platonov)\
**Post date:** [September 2, 2022, 1:46pm UTC](https://forum.uipath.com/t/python-scope/469978/11 "2022-09-02T13:46:58Z")

</div>

Try to install python from here [Python Release Python 3.10.1 | Python.org](https://www.python.org/downloads/release/python-3101/) and then restart the machine.

Based on [https://docs.uipath.com/activities/docs/release-notes-python-activities](https://docs.uipath.com/activities/docs/release-notes-python-activities) , in v1.6.0 we fixed an issue where UiPath.Python.Activities v1.4.1 would not support Python v3.10.1.

Let us know if this helped.

---

<div class="post-metadata">

**Author:** ![pritikumaricetpa](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pritikumaricetpa/32/365854_2.png) [@pritikumaricetpa](https://forum.uipath.com/u/pritikumaricetpa)\
**Post date:** [February 2, 2023, 9:05am UTC](https://forum.uipath.com/t/python-scope/469978/12 "2023-02-02T09:05:47Z")

</div>

The python scope must be defined as it cannot be accessed from anywhere in the program. The particular coding region where variables are visible is known as scope. Variables are not visible to the entire code. Their visibility can be restricted. Scope verifies which variable can be Seen. The scope defines the set of rules which tell us how and where a variable can be searched. The variable is searched either to retrieve a value or for assigning value. The namespace is the unique identification of the variable or the method. Namespace tells the python interpreter about the name of the object and the location from where it is trying to access it.  
The Variables which are defined in the function are a local scope of the variable. These variables are defined in the function body. Let’s understand this concept with the help of an example.  
we have taken one variable num. Num = 0 is defined outside the function, so it is not a local variable. As per our definition, the variables which are declared inside the function body is a local variable. Here num=1 is a local variable that is declared and printed inside the function demo. If we run this code, the output is given below.

num=0  
def demo():  
#print(num)  
num=1  
print(“The Number is:”,num)  
demo()

---

<div class="post-metadata">

**Author:** ![RoshanJha](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/roshanjha/32/407289_2.png) [@RoshanJha](https://forum.uipath.com/u/RoshanJha)\
**Post date:** [May 5, 2024, 5:49am UTC](https://forum.uipath.com/t/python-scope/469978/13 "2024-05-05T05:49:22Z")

</div>

Is there any way in UiPath to make the python scope global so that we can invoke the python script from anywhere in the code without reinitialling it all over again from different flows?
