DllNotFoundException on .net 6 with python 3.12 #2340
Replies: 5 comments 2 replies
|
For Python x64 use x64 profile app (Any CPU - not working) |
|
Is there a chance you're just not installing the package correctly? # from your .csproj directory
dotnet add package pythonnetOr possibly Python itself? Sounds like Python wasn't added to your environment PATH variables. Our Stock Indicators for Python QuickStart may help with more details on how to setup your environment, though our use case is a bit different. |
|
Hey, @software6ptk , did you solve the problem? |
|
I'm having ecapt same issue. Weird thing is that on my dev computer, I got it working. Then I updated my app's Flight in MS store and tested with my laptop: getting the dllNotFound whatever I do. Tried several different versions and also checked that maybe the python38.dll (or 310.dll) has some dependency missing, but no... |
I used something like that and worked to me and I create configuration manger of X64 to be combatable with with my vs and here where python live |
Uh oh!
There was an error while loading. Please reload this page.
Environment
Details
I am trying to setup pythonnet to run some python scripts in my c# app, but i'm getting the usual DllNotFoundException when setting the Runtime.PythonDLL variable
If i'm not wrong, both the python version and the .net runtime are supported so that shouldn't be the issue


this is what i do
string dllpth = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); dllpth += "\\Local\\Programs\\Python\\Python312\\python312.dll"; Runtime.PythonDLL = dllpth; PythonEngine.Initialize();i also tried
string dllpth = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); dllpth += "\\Local\\Programs\\Python\\Python312\\python312.dll"; Environment.SetEnvironmentVariable("PYTHONNET_PYDLL", dllpth); PythonEngine.Initialize();Errors are:
and
with details:
I already tried:
I also searched online for a solution, but can't find anything besides changing the build target
Can you please help me?
All reactions