Invoke python code , module 'os' has no attribute 'add_dll_directory'

Hello ,

I try to invoke a python script to manipulate detection object with opencv , numpy , imutils

when i execute the script i have this error

AttributeError : module ‘os’ has no attribute ‘add_dll_directory’

It’s relative to 3.7 version of python or another issue.

Thank you for your help.

@kowts any help please

we want to process an image and detect an object inside
but without calling a rest api like google vision
we want to execute a python script in localhost
we tried some exemple in github , we use opencv , numpy , imutils
but i have always this error AttributeError : module ‘os’ has no attribute ‘add_dll_directory’
It’s relative to 3.7 version of python or another issue?
have you an exemple of python script with these library worked in openrpa

thank you

This attribute was introduced in Python 3.8 to modify the DLL search path used by the operating system. OpenRPA is using 3.7

Thank you @Allan_Zimmermann ,

Is there a possibility to upgrade python version ?

the most python script use 3.8 and higher.

I think it will be more appreciated knowing that the use of python invoke code is important than vb, c#, power shell ,

That would be nice yes. You are welcome to reach out to the developer of the Python.Included and ask if that is possible. If they make that, I would be happy to update openrpa to use the new version

Alternatively, you can use agent’s to run the code, here you can control everything.

1 Like

Thank you for your help ,

I found this project which can be an alternative to henon/Python.Included

Hello, I’m using the Pandas library in my invoke code. Throwing, however, is error #ModuleNotFoundError : No module named ‘pandas’. nonetheless, I’m using standard OS, csv, zip file, and date features in Python, and they work just well. Is there a path problem or where should I set the path using the invoke code python on libraries?

You need to install the modules you need first.
OpenRPA by default uses python embedded, you can install packages using the pip installa activity or see this post for info about how do do it from command line

Thank you,The pandas scripts are located in Lib/Site-package/Pandas because I had installed the modules using pip install pandas. But the invoke code still produces the same issue when run. Many people are struggling with this issue. Could you please offer a YouTube video or screen recording attachment. its assistance to all persons.

as already explained, you need to install the libs the correct place.
use the acticity “pip install” or install by running pip install from C:\Users\%USERNAME%\AppData\Local\python-3.7.3-embed-amd64

packages stored in your system python location will not work. OpenRPA by default uses python embedded. which is store at C:\Users%USERNAME%\AppData\Local\python-3.7.3-embed-amd64
Use pip install activity and install packages using that (use force install true when you run for first time).

thank you for that, I 've been using an external python instalation, this seems to be far easier

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