I installed pythonnet in c# directly using NuGet, but setting runtime. PythonDLL shows that this field is read-only and cannot be changed enter image description here
But pythonnet requires runtime. PythonDLL to be set enter image description here
I installed pythonnet in c# directly using NuGet, but setting runtime. PythonDLL shows that this field is read-only and cannot be changed enter image description here
But pythonnet requires runtime. PythonDLL to be set enter image description here
try calling PythonDll by specifying the location paths in advance in this way:
string pythonRepos = @"Python39\";
string pythobLib = @"Python39\Lib\site-packages\";
Environment.SetEnvironmentVariable("PATH", pythonRepos, EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("PYTHONHOME", pythonRepos, EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("PYTHONPATH", pythobLib, EnvironmentVariableTarget.Process);
Maybe this will solve your problem.