# Load Python Script: One or more errors occurred

**URL:** <https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497>\
**Category:** Studio\
**Tags:** pr-welcome, python, activities\
**Created:** [October 24, 2020, 3:26pm UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497 "2020-10-24T15:26:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![edang](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/edang/32/180560_2.png) [@edang](https://forum.uipath.com/u/edang)\
**Post date:** [October 24, 2020, 3:26pm UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/1 "2020-10-24T15:26:28Z")

</div>

Hi, I’m a new user for UiPath,

In “Main.xaml” here in my attachment, I’m trying to load a python script, and I have this error “Load Python Script: One or more errors occurred.”

How can I overcome this? Seek help please

[text-summarizer.zip](https://forum.uipath.com/uploads/short-url/b7jgsCaZPZCa4aIUrpR0XbfUvSg.zip) (3.8 KB)

---

<div class="post-metadata">

**Author:** ![gustavo.cervelin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gustavo.cervelin/32/520628_2.png) [@gustavo.cervelin](https://forum.uipath.com/u/gustavo.cervelin)\
**Post date:** [October 26, 2020, 2:54pm UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/2 "2020-10-26T14:54:52Z")

</div>

Hi @edang,

Could you share a printscreen of files and folder you have in “C:\Users\edang\anaconda3\envs\mldds3”?

Also, kindly share more details about the exception

In my case, in “Path” input field of Python Scope activity I am using “C:\Python”

And I have these files and folder inside of it:

 ![Captura de Tela 2020-10-26 às 11.50.30](https://global.discourse-cdn.com/uipath/original/3X/7/c/7c5d485d67e072d2eee0e348823164d52e8beddb.png)

---

<div class="post-metadata">

**Author:** ![edang](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/edang/32/180560_2.png) [@edang](https://forum.uipath.com/u/edang)\
**Post date:** [October 27, 2020, 2:25pm UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/3 "2020-10-27T14:25:19Z")

</div>

[exception\_info.zip](https://forum.uipath.com/uploads/short-url/x3qXnZGcuL8l8sEOZpFxdjCGXeu.zip) (808.6 KB)  
Thank you Gustavo! for taking a look,

i attached a printscreen of error message displayed in UIPath Studio.  
I also attached a printscreen of the file folder containing the python executable

I was reading another post in UIpath forum:  
[How to run Python Script](https://forum.uipath.com/t/how-to-run-python-script/190903)

In this post, Palaniyappan provided a sample UIPath process “PythonActivitiesTest” which loads a simple python script. I had successfully run this sample UIPath process using my environment in "C:\Users\edang\anaconda3\envs\mldds3”…

Seek advice…

---

<div class="post-metadata">

**Author:** ![gustavo.cervelin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gustavo.cervelin/32/520628_2.png) [@gustavo.cervelin](https://forum.uipath.com/u/gustavo.cervelin)\
**Post date:** [October 27, 2020, 2:52pm UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/4 "2020-10-27T14:52:53Z")

</div>

Hi @edang,

Let’s test something…

To make sure it is a general problem, create a simple .py file. Something like this:

```
def test():
 return 123

```

Then, reference this new file instead of the other one (text-summarizer.py). But use the same project you were working on.

If it works, there is something wrong in text-summarizer.py

If it doesn’t, the error is something general.

---

<div class="post-metadata">

**Author:** ![gustavo.cervelin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gustavo.cervelin/32/520628_2.png) [@gustavo.cervelin](https://forum.uipath.com/u/gustavo.cervelin)\
**Post date:** [October 27, 2020, 2:58pm UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/5 "2020-10-27T14:58:57Z")

</div>

Also, make sure you have python 3.6.X version installed

 ![Captura de Tela 2020-10-27 às 11.58.51](https://global.discourse-cdn.com/uipath/original/3X/9/5/9525e2afb4e96a2f1cce7ae88fa8fe3e96bb29e3.png)

---

<div class="post-metadata">

**Author:** ![edang](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/edang/32/180560_2.png) [@edang](https://forum.uipath.com/u/edang)\
**Post date:** [October 28, 2020, 12:12am UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/6 "2020-10-28T00:12:24Z")

</div>

Yes, the version i’m using is 3.6.10

---

<div class="post-metadata">

**Author:** ![edang](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/edang/32/180560_2.png) [@edang](https://forum.uipath.com/u/edang)\
**Post date:** [October 28, 2020, 12:19am UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/7 "2020-10-28T00:19:36Z")

</div>

Hi the simple test.py script works for my python enviromment.

The ‘text-summarizer.py’ script works independently without using UIPath. This script is actually from this here: [Understand Text Summarization](https://towardsdatascience.com/understand-text-summarization-and-create-your-own-summarizer-in-python-b26a9f09fc70)  
So i think it is well tested to work

So i guess the issue is related around loading of Python Script in UIPath Studio…

---

<div class="post-metadata">

**Author:** ![gustavo.cervelin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gustavo.cervelin/32/520628_2.png) [@gustavo.cervelin](https://forum.uipath.com/u/gustavo.cervelin)\
**Post date:** [October 28, 2020, 12:36am UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/8 "2020-10-28T00:36:54Z")

</div>

Hi @edang,

Have you tried to load this test.py in UiPath Studio (same project you were working on)?

---

<div class="post-metadata">

**Author:** ![edang](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/edang/32/180560_2.png) [@edang](https://forum.uipath.com/u/edang)\
**Post date:** [October 28, 2020, 1:22am UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/9 "2020-10-28T01:22:14Z")

</div>

Yes, I was able to load ‘test.py’ successfully in UIPath Studio. It runs ok too.

---

<div class="post-metadata">

**Author:** ![gustavo.cervelin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gustavo.cervelin/32/520628_2.png) [@gustavo.cervelin](https://forum.uipath.com/u/gustavo.cervelin)\
**Post date:** [October 28, 2020, 2:24am UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/10 "2020-10-28T02:24:36Z")

</div>

Hi @edang,

Got it…

Now, let’s change our test.py file:

```
#!/usr/bin/env python
# coding: utf-8
import nltk
from nltk.corpus import stopwords
from nltk.cluster.util import cosine_distance
import numpy as np
import networkx as nx

def test():
 return 123

```

Then, test it again in same UiPath project as before, please.

Now, if it doesn’t load the script properly, we found where the error is going on… importing dependencies.

If my guess is confirmed, let me know and I’ll show you the next steps.

Thanks

---

<div class="post-metadata">

**Author:** ![edang](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/edang/32/180560_2.png) [@edang](https://forum.uipath.com/u/edang)\
**Post date:** [October 28, 2020, 5:09am UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/11 "2020-10-28T05:09:54Z")

</div>

Hi Gustavo,  
Haha 🙂 I faced the same error from UIPath Studio when I try to load the updated ‘test.py’

FYI I can run text-summarizer.py successfully using my python environment (without UIPath Studio use), so my python environment have the required python libraries

---

<div class="post-metadata">

**Author:** ![gustavo.cervelin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gustavo.cervelin/32/520628_2.png) [@gustavo.cervelin](https://forum.uipath.com/u/gustavo.cervelin)\
**Post date:** [October 28, 2020, 11:49am UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/12 "2020-10-28T11:49:06Z")

</div>

Hi @edang,

So, your error is related to Python project dependences in UiPath Studio. Because if you run test.py using your Python environment it works. Also, if you delete import rows, test.py works in UiPath Studio too.

Let’s say this python project’s dependencies aren’t visible to your UiPath project.

Instead of copying your .py file from Python project and pasting it in your UiPathStudio, try to indicate .py original path. I mean, it’s located inside your Python project path. Example: C:/Users/Gustavo/PycharmProjects/TestProject/test.py

This can work because in that directory the environment is set and has everything you need to run.

Please, try it and let me know.

---

<div class="post-metadata">

**Author:** ![edang](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/edang/32/180560_2.png) [@edang](https://forum.uipath.com/u/edang)\
**Post date:** [October 28, 2020, 1:26pm UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/13 "2020-10-28T13:26:43Z")

</div>

Hi Gustavo, no change…

i had actually placed both in the same folder:

- UIPath script (which loads the python script)
- ‘test.py’

In this folder:

- With the right python environment containing necessary dependencies loaded in Pycharm, i was able to execute ‘test.py’ in this folder

I reduce the number of ‘imports’ in ‘test.py’ to just a single import to use a popular/widely used Numpy library. UIPath can’t load this simplified script…

 ![test python script](https://global.discourse-cdn.com/uipath/original/3X/7/4/741225a161314d319ecdfc5d0085e38893a9a3b2.jpeg)

---

<div class="post-metadata">

**Author:** ![gustavo.cervelin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gustavo.cervelin/32/520628_2.png) [@gustavo.cervelin](https://forum.uipath.com/u/gustavo.cervelin)\
**Post date:** [October 28, 2020, 2:09pm UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/14 "2020-10-28T14:09:07Z")

</div>

Hi @edang,

Got it ☹

I faced this same problem when I was working on a project which loads a .py file with “imports”, but honestly I can’t remember now how I solved it.

I remember I changed Windows environment variables, pointing “Path” variable to Python\ and Python\Scripts\ paths, as you can see in image below.

 ![Captura de Tela 2020-10-28 às 11.01.24](https://global.discourse-cdn.com/uipath/original/3X/d/e/de8bef9d4fe62d45f8d55f60c9184f73b5ab6bb7.png)

Perhaps, that’s what makes Python installed dependencies “visible” to UiPath projects.

Try this, please.

in your case, you’ll use C:\Users\edang\anaconda3\envs\mldds3\ and C:\Users\edang\anaconda3\envs\mldds3\Scripts\

---

<div class="post-metadata">

**Author:** ![edang](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/edang/32/180560_2.png) [@edang](https://forum.uipath.com/u/edang)\
**Post date:** [October 28, 2020, 3:03pm UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/15 "2020-10-28T15:03:17Z")

</div>

Hi Gustavo, after adding to Windows enviroment variable path, no change… Same error

 ![win env](https://global.discourse-cdn.com/uipath/original/3X/2/d/2d3bf6d8cfdf37b960f0ef2bc976f084c6cb5810.jpeg)

---

<div class="post-metadata">

**Author:** ![edang](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/edang/32/180560_2.png) [@edang](https://forum.uipath.com/u/edang)\
**Post date:** [October 28, 2020, 3:04pm UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/16 "2020-10-28T15:04:12Z")

</div>

This diagram shows the full exception error message

 ![load_python_script_error2](https://global.discourse-cdn.com/uipath/original/3X/a/6/a6fca642e55f47ac45f4bdf65c0f27fe800d58e1.jpeg)

---

<div class="post-metadata">

**Author:** ![gustavo.cervelin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gustavo.cervelin/32/520628_2.png) [@gustavo.cervelin](https://forum.uipath.com/u/gustavo.cervelin)\
**Post date:** [October 28, 2020, 11:56pm UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/17 "2020-10-28T23:56:13Z")

</div>

Hi @edang,

I saw the exception. It’s about .py dependencies.

They need to be accessible to UiPath.

Try to open PyCharm \> open terminal \> go to your UiPath project folder \> type `pip show numpy`.

Does it return something?

> [@Python Activity Troubleshooting](https://forum.uipath.com/t/python-activity-troubleshooting/199227):
>
> Step-A: (Validate the Configuration parameters) Check the Python exe file path location is properly specified in Python Scope properties Check the installed Python version is 64-bit or 32-bit. In case of 32-bit version select x86 Specify the Python version installed. It is always better to specify the Python version rather selecting Auto. [image] Step-B: Instead of using " Run Python Script " activity, use Load Python Script → Invoke Python Method → Get Python Object . Remove the Print …

---

<div class="post-metadata">

**Author:** ![edang](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/edang/32/180560_2.png) [@edang](https://forum.uipath.com/u/edang)\
**Post date:** [October 29, 2020, 12:16am UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/18 "2020-10-29T00:16:36Z")

</div>

Hi Gustavo, Yes it does show:

 ![pip_show_numpy](https://global.discourse-cdn.com/uipath/original/3X/8/8/88e51162fe280809b7cd2d7a30e9f518767d6263.jpeg)

---

<div class="post-metadata">

**Author:** ![gustavo.cervelin](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gustavo.cervelin/32/520628_2.png) [@gustavo.cervelin](https://forum.uipath.com/u/gustavo.cervelin)\
**Post date:** [October 29, 2020, 1:53am UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/19 "2020-10-29T01:53:30Z")

</div>

Hi edang,

I’m running out of ideas, sorry ☹

We would need to connect to try to solve this problem.

If you want, send me a private message.

---

<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:** [November 19, 2020, 2:55pm UTC](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497/22 "2020-11-19T14:55:21Z")

</div>

Hi @edang

Could you double check the below?

> The problem is related to incorrect setup of the Python environment.
> 
> Make sure the Python version used has all the required packages installed, the working folder is set to the folder that keeps all the resources that are used in the Python script using relative paths - to the working folder - and the script is referenced to the full path of the script in Load script.
> 
> A test that verifies that everything is set up right is to run the script from windows command prompt as “python.exe script.py” where script.py is the script used in the project.

[Next page](https://forum.uipath.com/t/load-python-script-one-or-more-errors-occurred/264497.md?page=2)
