Pythonnet error: dynamic module not initialized correctly

I have Windows 7 x64 and Python version 2.4.6 on win32. Installed Frames:

Microsoft.NET Framework 4.5.2 Microsoft Multi-Targeting Pack for Microsoft.NET Framework 4. So, when I launch my application, it breaks into:

import clr

with this error:

SystemError: dynamic module not initialized properly

I am also rebuilding pythonnet using Visual C # 2010 express, with the x86 platform, but nothing.

Can someone help me please. And maybe someone will tell me that the .NET Framework is installed to use pythonnet.

+4
source share
2 answers

I also had this behavior. I fixed it by installing Python.net via pip:

python -m pip install pythonnet (, Administrator/root)

> python
> import clr
+2

- , clr.pyd Python.Runtime.dll. clr.pyd, clr.pyd Python.Runtime.dll. , dll , Python.Runtime.dll System PATH.

, main.py, import clr clr.pyd Python.Runtime.dll , main.py:

import sys
import os

sys.path.insert(0, os.path.abspath('./')) # add the current file location to sys path so that the clr module is searchable
+1

Source: https://habr.com/ru/post/1625203/


All Articles