Environment - PythonNET version: 3.0.5
- Python Version: 3.9
- Operating System: Windows 10
- .NET Framework 4.7.2
- Visual Studio 2019
Hello everyone! It's my first time posting on this community, so I'm sorry advance if there's any information missing in this post. I will edit accordingly in that case. I have the following: using Python.Runtime;namespace Test_PythonNET{ class Program { static void Main(string[] args) { RunScript("PythonApplication3"); } public static void RunScript(string scriptName) { Runtime.PythonDLL = @"C:\Program Files(x86)\Microsoft Visual Studio\Shared\Python39_64\python39.dll"; PythonEngine.Initialize(); using (Py.GIL()) { var pythonScript = Py.Import(scriptName); pythonScript.InvokeMethod("say_hello"); } } }}
I've already set: Properties > Build > Platform Target x86. It's giving me (apparently the very common) error of: Exception Unhandled System.TypeInitializationException: 'The type initializer for 'Delegates' threw an exception.' 2 of 2 Inner Exceptions Win32Exception: The specified module could not be found
I have the following Individual components installed:
 Any idea what I'm possibly doing wrong? I found other similar discussions but I don't think any of them installed Python the same way I did. It's my first time using both Python and Python.NET. Thank you! |