-1

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

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 16 '21 at 10:32

1 Answers1

0

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.