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
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.
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
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
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.
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.