what version bundle does pythonnet_py35_dotnet work in?

  • Windows 8.1
  • Visual Studio 2015
  • NuGet pythonnet_py35_dotnet 2.3.0

I've tried about 15 different versions.

Conda with python 3.5.0, 3.5.2, 3.5.4, 3.7.5 and many more different versions... Python 3.5.0, 3.5.4, 3.7.5, 3.6.2 and many more different versions... PythonNet 2.4.0, 2.3.0, 2.2.0

Does this library even work?

In the worst case scenario, I get an error.

Fatal Python error: Py_Initialize: Unable to get the locale encoding

In the most ordinary case.

Unable to load DLL 'python35': The specified module could not be found. (Exception from HRESULT: 0x8007007E

I've been trying to solve the problem for 30 hours straight...

    Dim tmpPath As String = "C:\Program Files (x86)\Anaconda3\;" + Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Machine)
    Environment.SetEnvironmentVariable("PATH", tmpPath, EnvironmentVariableTarget.Process)
    Environment.SetEnvironmentVariable("PYTHONHOME", "C:\Program Files (x86)\Anaconda3\;", EnvironmentVariableTarget.Process)
    Environment.SetEnvironmentVariable("PYTHONPATH ", "C:\Program Files (x86)\Anaconda3\Lib\;", EnvironmentVariableTarget.Process)


    Using Py.GIL()

    End Using

1 Answer


I am successfully working with pythonnet for a while, with different pythonnet and Python versions (3.5, 3.6, also Anaconda).

You may have a path (whitespaces) or permissions issue, try installing Anaconda into "C:\Anaconda3".

Also make sure the bitness is matched between Python, pythonnet and .NET project platform - all three should be 64-bit (or all three 32-bit).

answered on Stack Overflow Dec 30, 2019 by ika

User contributions licensed under CC BY-SA 3.0