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
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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Environment
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:
I've already set: Properties > Build > Platform Target x86.
It's giving me (apparently the very common) error of:
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!
Beta Was this translation helpful? Give feedback.
All reactions