Help getting startet

OpenRPA version: 1.4.57
OpenFlow version: 1.5.11.116 selfhosted

Error message:

Exception has occurred: LibraryLoadError
Failed to load library: [WinError 193] %1 is not a valid Win32 application
OSError: [WinError 193] %1 is not a valid Win32 application

During handling of the above exception, another exception occurred:

  File "C:\Users\Michael\OneDrive\Dokumenter\RPAProjects\testProject\main.py", line 11, in __init__
    self.client = Client()
                  ~~~~~~^^
  File "C:\Users\Michael\OneDrive\Dokumenter\RPAProjects\testProject\main.py", line 139, in <module>
    worker = Worker()
openiap.main.LibraryLoadError: Failed to load library: [WinError 193] %1 is not a valid Win32 application

Screenshot or video:

Attach a simple workflow from OpenRPA or NodeRED that reproduces the error/issue:
I’m using windows, and just opened op vs code, pressed F1 and used the “Initialize project, ensure openiap/opencore credentials.” I selected a Python version.
Then I click the debug with launch.json, and the error occur.

I have tried to just pack the default version and uploaded it, creating an agent and a queue item, and a queue.
But that didn’t gave me anything.
I think i found a bug in the Work Item Queues, when i try to add a Package (maybe i don’t understand the purpose): Error
packageid is Expected string, received object

This is the problem … somehow the Python module is refusing to run on your Windows machine.
I must admit, I rarely test on Windows. Let me quickly set up something so I can see if this is a general problem on Windows.

damn it … python is broken on both macos and windows right now … I’ll get it fixed asap
Nodejs, and others seem to work just fine.

thank you, looking forward to hear from you

Man, that took forever …
python was referencing the wrong library on windows and macos.
dotnet had a bug where it would not register the dll importer properly on windows. it now works on linux, macos and windows, but somehow it still fails when loaded from powershell on windows.

I’ve gone through all 24 example repositories testing all 11 languages on linux, windows and macos. Everything is working perfectly except

  • php refuses to run on my windows box for some reason, but my test works on linux and macos
  • powershell works on linux and macos, but fails on windows for some reason works now

How do i get and use the updated version? I open VS Code, and the extension is set to autoupdate, and i have version 0.0.40.
I have just updated to latest Python version 3.13.3.
I blanked the project and initialized it again, and the code still fails with the same error.

Traceback (most recent call last):
  File "c:\Users\Michael\OneDrive\Dokumenter\RPAProjects\testProject2\main.py", line 71, in <module>
    client = Client()
  File "C:\Users\Michael\AppData\Roaming\Python\Python313\site-packages\openiap\main.py", line 518, in __init__
    self.lib = self._load_library()
               ~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\Michael\AppData\Roaming\Python\Python313\site-packages\openiap\main.py", line 598, in _load_library
    raise LibraryLoadError(f"Failed to load library: {e}")
openiap.main.LibraryLoadError: Failed to load library: [WinError 193] %1 is not a valid Win32 application

Some things may come easy, but this is new teritory for me, and i think the learning curve is a bit steep :slight_smile:

Sorry, you are right…
It depends on how you installed the Python library.

requirements.txt

If you used

pip install openiap
#or
pip install -r requirements.txt

then run

pip uninstall openiap-edge

If you installed using

pip install -t . -r requirements.txt

then delete the two folders called openiap and openiap_edge-version-number

Then update requirements.txt to have the latest version

openiap-edge==0.0.36

and install it again, preferably using

pip install -t . -r requirements.txt

conda

If you installed using micromamba or conda

micromamba create -y -n pythontest -f conda.yaml
# or
micromamba install -y -n pythontest -f conda.yaml

then simply update conda.yaml to use the latest version

name: 
channels:
    - conda-forge
dependencies:
    - python
    - pip
    - pip:
      - openiap-edge==0.0.36

and run below to update

micromamba install -y -n pythontest -f conda.yaml

Just to make it a bit more fun, i tried the .net version, and it requires version 6.0.0 which is out of support? and thereby not installed by default. Will you consider supporting version 9?

Architecture: x64
Framework: 'Microsoft.NETCore.App', version '6.0.0' (x64)
.NET location: C:\Program Files\dotnet\

The following frameworks were found:
  8.0.14 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  8.0.15 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  9.0.3 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Learn more:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.0&arch=x64&rid=win-x64&os=win10

Browse all .NET versions to download | .NET ← .net 6.0 had end of support 2024.

All my examples are using .NET 6, but the library also supports .NET 8 and .NET 9. Simply update dotnettest.csproj:
find

<TargetFramework>net6.0</TargetFramework>

and change it to

<TargetFramework>net8.0</TargetFramework>

or

<TargetFramework>net9.0</TargetFramework>

In the old days, we used to be able to target multiple frameworks, but somehow I cannot make that work in the examples… If you know, I would love to know how you did it.

never mind, I found it out, so if you want multiple versions, change

<TargetFramework>net6.0</TargetFramework>

to

<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>

then you can run it with

dotnet run --framework net9.0

thank you Allan, now i have a working python demo.
I tend to have issues popping existing queue items.
I ended up deleting all queues and items, and started over, and now it pops.

1 Like

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