[Python.NET] ImportError: dynamic module does not define init function (initclr)
JVinke at nassco.com
Wed Jan 8 21:09:10 CET 2014
I tried to get PythonNet working on a Windows 7 machine with Python 2.6.6 installed. My test program is very simple:
print "before import of clr"
print "done importing clr"
When I run the above in Pythonwin, I get this error:
ImportError: dynamic module does not define init function (initclr)
I have these packages installed (names of the installers are listed here):
python-2.6.6.msi (we must use 2.6 because of an application dependency --> Aveva Marine)
wxPython2.8-win32-ansi-22.214.171.124-py26.exe (and we must use wx......ansi-126.96.36.199..... because it's the only one that works in Aveva Marine 12.1.4)
I retrieved this zip file from the PythonNet site (on sourceforge):
And unzipped it and placed the contents of the UCS2 sub-directory (except for the python.exe) in the C:\python26 directory. (Including the clr.pyd and the Python.Runtime.dll). The simple test program I have above is also in the C:\python26 directory. And the PYTHONPATH environment variable contains C:\python26 (and a few other folders/directories).
But I can't even get the first real statement - import clr - to work.
I apologize if this ends up being a complete newbie question.
If you have any ideas on what I'm missing, I would be extremely grateful.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PythonDotNet