-
Notifications
You must be signed in to change notification settings - Fork 546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to load DLL 'libSkiaSharp' - Python wrapper based Web API #3040
Comments
Hi! Any updates on this? I am getting the same. |
You are loading the managed (.NET) dlls, but have not made sure the native parts are able to be found. You can't reference them directly via the CLR, but if they are in the same folder as the managed dlls, they should be found: https://www.nuget.org/packages/SkiaSharp.NativeAssets.Win32 I think all of this will work if you publish your .NET app and then use that. Publishing will copy all references and dependencies into the output. You can then load the dlls, and they should find the native libraries. |
@mattleibow , We are still getting the exception after including the native libSkiaSharp.dll. `PS D:\Word-to-PDF-Python\Word-to-PDF-Python\API files in Python> python SkiaSharpSample.py The above exception was the direct cause of the following exception: Traceback (most recent call last): Unhandled Exception: System.TypeInitializationException: The type initializer for 'SkiaSharp.SKObject' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'libSkiaSharp': The specified module could not be found. (Exception from HRESULT: 0x8007007E) |
Are you able to zip up the samples so I can look? |
I have tried below approach, but not works.
You can find the things we tried and error faced details in attached Word document. Also, the PythonWrapper.zip contains the .NET application and python code. Could you please try and suggest solution with runnable sample. |
@mattleibow , Any update on this? Does we missed anything in given sample? |
Description
We are creating python wrapper based Web API to call C# method via python. While using SkiaSharp related code, we facing errors even loaded the SkiaSharp dlls in python.
Target: .NET Standard 2.0
Python version : 3.9
Any workaround also helpful.
Code
Python:
C#:
Replication steps
Expected Behavior
Work properly
Actual Behavior
Exception
Version of SkiaSharp
SkiaSharp.HarfBuzz,"2.88.8"
Last Known Good Version of SkiaSharp
6.88.6 (Deprecated)
IDE / Editor
Visual Studio Code (Windows)
Platform / Operating System
Windows
Relevant Log Output
Code of Conduct
The text was updated successfully, but these errors were encountered: