You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Azure AppService and System.DllNotFoundException: Could not load python311.dll with flags RTLD_NOW | RTLD_GLOBAL: python311.dll: cannot open shared object file: No such file or directory
#120
When running the project locally, the project along with Numpy-related code works fine.
But, after deployment to the Azure AppService, website stopped working with error:
Unhandled exception. System.TypeInitializationException: The type initializer for 'Delegates' threw an exception.
---> System.DllNotFoundException: Could not load python311.dll with flags RTLD_NOW | RTLD_GLOBAL: python311.dll: cannot open shared object file: No such file or directory
at Python.Runtime.Platform.PosixLoader.Load(String dllToLoad)
at Python.Runtime.Runtime.Delegates.GetUnmanagedDll(String libraryName)
at Python.Runtime.Runtime.Delegates..cctor()
--- End of inner exception stack trace ---
at Python.Runtime.PythonEngine.Initialize(IEnumerable`1 args, Boolean setSysArgv, Boolean initSigs)
at Python.Runtime.PythonEngine.Initialize(Boolean setSysArgv, Boolean initSigs)
at Python.Runtime.PythonEngine.Initialize()
at Numpy.np.InstallAndImport(Boolean force)
at Numpy.np.<>c.b__531_0()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at Numpy.np.get_self()
at Numpy.np.arange(Int32 stop, Int32 step, Dtype dtype)
// ..
I'm using initialization of Python in the Program.cs before CreateHostBuilder(args).Build();:
Any ideas what's wrong? Is that because of installation fails? If yes, is it possible to use portable Python that is placed under application after build?
Note that targeted machine is a Linux, but the project is used locally in Windows/Linux/Mac environments.
The text was updated successfully, but these errors were encountered:
I'll look later when I got time as I am quite busy but you can check out Python.Included which is used by numpy.net under the hood and see if you find out yourself.
Yes Python.Included and Numpy.NET are Windows only libs because they contain the windows version of python and numpy, but they each have a companion library that can be used with linux. You have to pack a linux version of python and the numpy wheel in your .NET assembly (as embedded resources) and then use Python.Deployment to install them. See the examples in the https://github.com/henon/Python.Included repo. Then you can use Numpy.Bare to use the numpy wheel you installed.
Hi, I'm using Numpy 3.11.1.33 and:
When running the project locally, the project along with Numpy-related code works fine.
But, after deployment to the Azure AppService, website stopped working with error:
I'm using initialization of Python in the Program.cs before
CreateHostBuilder(args).Build();
:Any ideas what's wrong? Is that because of installation fails? If yes, is it possible to use portable Python that is placed under application after build?
Note that targeted machine is a Linux, but the project is used locally in Windows/Linux/Mac environments.
The text was updated successfully, but these errors were encountered: