# Error in loading python script in python scope

**URL:** <https://forum.uipath.com/t/error-in-loading-python-script-in-python-scope/138405>\
**Category:** Help\
**Tags:** studio, python, error, activities\
**Created:** [July 31, 2019, 5:38am UTC](https://forum.uipath.com/t/error-in-loading-python-script-in-python-scope/138405 "2019-07-31T05:38:17Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshay\_Singh](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/akshay_singh/32/61284_2.png) [@Akshay\_Singh](https://forum.uipath.com/u/Akshay_Singh)\
**Post date:** [July 31, 2019, 5:38am UTC](https://forum.uipath.com/t/error-in-loading-python-script-in-python-scope/138405/1 "2019-07-31T05:38:18Z")

</div>

Hi,  
I am trying to use python scope activity to invoke python script but after running workflow it show  
Source: Load Python Script  
Message: Error loading Python script  
Exception Type: System.InvalidOperationException

If i am running my script manually it runs successfully but when i invoke in UiPath it show error.  
I have attach my workflow, script and images also.  
Thank you  
Akshay[RPA\_IMAGE\_TO\_PDF\_PROJECT22.zip](https://forum.uipath.com/uploads/short-url/hEcdyFTHnrFkMKwHsykNM3oD327.zip) (391.7 KB)

---

<div class="post-metadata">

**Author:** ![loginerror](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/loginerror/32/22614_2.png) [@loginerror](https://forum.uipath.com/u/loginerror)\
**Post date:** [July 31, 2019, 7:37am UTC](https://forum.uipath.com/t/error-in-loading-python-script-in-python-scope/138405/2 "2019-07-31T07:37:27Z")

</div>

Hi @Akshay_Singh

Could you give these topics a read?  
[https://forum.uipath.com/search?q=Error%20loading%20Python%20script%20status%3Asolved](https://forum.uipath.com/search?q=Error%20loading%20Python%20script%20status%3Asolved)

Each contains a post marked as a solution to this error message.

---

<div class="post-metadata">

**Author:** ![Akshay\_Singh](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/akshay_singh/32/61284_2.png) [@Akshay\_Singh](https://forum.uipath.com/u/Akshay_Singh)\
**Post date:** [July 31, 2019, 7:57am UTC](https://forum.uipath.com/t/error-in-loading-python-script-in-python-scope/138405/3 "2019-07-31T07:57:50Z")

</div>

yes i have read this but than also it showing same error.  
That why i have raised this question.

---

<div class="post-metadata">

**Author:** ![ashley11](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ashley11/32/67457_2.png) [@ashley11](https://forum.uipath.com/u/ashley11)\
**Post date:** [July 31, 2019, 10:12am UTC](https://forum.uipath.com/t/error-in-loading-python-script-in-python-scope/138405/4 "2019-07-31T10:12:22Z")

</div>

i saw your code  
wanted to know few things

1. why you what’s your pc architecture 32 bit or 64 bit  
if its 64 bit then you have set it wrong in **python scope** activity

2. Your python code does not accept any parameters then why are you passing the path from uipath to the code?  
your function is  
**def testfun():**  
not **def testfun(some\_argument):**

3. version keep it **AUTO** in python scope  
i will attach the modified python and uipath code try if it works

---

<div class="post-metadata">

**Author:** ![Akshay\_Singh](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/akshay_singh/32/61284_2.png) [@Akshay\_Singh](https://forum.uipath.com/u/Akshay_Singh)\
**Post date:** [July 31, 2019, 10:20am UTC](https://forum.uipath.com/t/error-in-loading-python-script-in-python-scope/138405/5 "2019-07-31T10:20:23Z")

</div>

ya its 64 bit  
Ok than in parameter i should leave it empty?  
and my function is def testfun(): so i have pass it as “testfun” only .  
Can you help me out

---

<div class="post-metadata">

**Author:** ![ashley11](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ashley11/32/67457_2.png) [@ashley11](https://forum.uipath.com/u/ashley11)\
**Post date:** [July 31, 2019, 10:23am UTC](https://forum.uipath.com/t/error-in-loading-python-script-in-python-scope/138405/6 "2019-07-31T10:23:25Z")

</div>

yes and donot pass anything in **input parameters** in **invoke python method** and set the version as automatic in python scope

---

<div class="post-metadata">

**Author:** ![Akshay\_Singh](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/akshay_singh/32/61284_2.png) [@Akshay\_Singh](https://forum.uipath.com/u/Akshay_Singh)\
**Post date:** [July 31, 2019, 10:24am UTC](https://forum.uipath.com/t/error-in-loading-python-script-in-python-scope/138405/7 "2019-07-31T10:24:27Z")

</div>

ok than in NAME section i should write function name as “testfun”?

---

<div class="post-metadata">

**Author:** ![ashley11](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ashley11/32/67457_2.png) [@ashley11](https://forum.uipath.com/u/ashley11)\
**Post date:** [July 31, 2019, 10:25am UTC](https://forum.uipath.com/t/error-in-loading-python-script-in-python-scope/138405/8 "2019-07-31T10:25:52Z")

</div>

yes correct

---

<div class="post-metadata">

**Author:** ![Akshay\_Singh](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/akshay_singh/32/61284_2.png) [@Akshay\_Singh](https://forum.uipath.com/u/Akshay_Singh)\
**Post date:** [July 31, 2019, 10:27am UTC](https://forum.uipath.com/t/error-in-loading-python-script-in-python-scope/138405/9 "2019-07-31T10:27:32Z")

</div>

but again it showing error

---

<div class="post-metadata">

**Author:** ![chenlin1](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@chenlin1](https://forum.uipath.com/u/chenlin1)\
**Post date:** [March 11, 2020, 1:15am UTC](https://forum.uipath.com/t/error-in-loading-python-script-in-python-scope/138405/11 "2020-03-11T01:15:46Z")

</div>

> [@ashley11](#):
>
> know few things

facing same problem, is this solved?
