Why Load Python Script activity can't read the Python modules despite already installed on my system?

Hi, everyone.

I tried to know why UiPath send me the follow error at “Load Python Script”:

Source: Load Python Script
Message: Error loading Python script
Exception Type: System.InvalidOperationException

Into this error message appear the follow message: “ModuleNotFoundError : No module named ‘pandas’”

I reviewed if that module exists on my system through Anaconda, and that’s right, including modules as “numpy”, “os”, “tabula”, among others.

So, I don’t know what’s the problem.

I hope that you help me, because this is the unique detail that stops me.

Thank you very much!

Hi @JCLuna,

Welcome to UiPath forum !

Try this below link:

Thanks,
Neelima.

Thanks, but, reading that issue, is different from what I need. My issue is UiPath does not recognize that Python modules/libraries as “numpy”, “pandas”, “tabula”, “tensorflow”, among others, are already installed. For this issue, UiPath show me the message at “Load Python Script” activity.

Do you suggest me reinstall UiPath or something else?

Thank you!

Did you try to run your script from the command line before integrating it to UiPath?

Yes. I did. But the most curiously is that I try run the script with the command prompt of Windows and appear the same message:

C:\Users\X>C:\Users\X\AppData\Local\Programs\Python\Python36\python.exe C:\Users\X\Documents\UiPath\Python_First_Test\Test.py
Traceback (most recent call last):
File “C:\Users\X\Documents\UiPath\Python_First_Test\Test.py”, line 4, in
import pandas as pd
ModuleNotFoundError: No module named ‘pandas’

In fact, into my script file, I tried to write this form:

import sys
import os
sys.path.append(“C:\Users\X\Documents\Python Scripts”)
import pandas as pd

But, it doesn’t function.

Thanks!

This article might helps

HI, I have the same problem as your’s.

Were you able to resolve?

My post of problem, which i later narrow the problem down to not being able to perform “import” function. So My problem looks to be the same as yours

Hi did u check whether pandas module is already installed?

Yes I was able perform “import panda” in python IDE (not uipath studio)

My case might be unique but this is how I got the issue resolved. For me, turned out it was due to confusion with having multiple versions of Python. In the IDE where the code worked fine for me, I checked the path where that version of Python was

import os
import sys
os.path.dirname(sys.executable)

When I used the path that came from this, into the Python Scope activity’s Input “Path” argument, it resolved the issue for me. Hope this helps!