Hi Bart,

the python26.dll is installed to the c:\windows\system32\ folder regardless of where your main Python installation goes to. I've seen similar problem when I have copied the Python26 folder to a new machine and forgot to take the python26.dll along. Check if you have the python26.dll in place and make sure you use the newly built python.exe interpreter.

It is indeed recommended to use the python.exe compiled with PythonNET as it does some additional initialization (see the implementation of the Initialize() method in pythonengine.cs code).

2011/2/8 Bart Jonkers <jonkersbart@gmail.com>
Hi,

I followed the instructions from oleskii to build Python.NET for .NET4.0.
Compilation wend fine but when I try to run python.exe I get the
following error:

Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'python26':
 The specified module could not be found. (Exception from HRESULT: 0x8007007E)
  at Python.Runtime.Runtime.Py_Initialize()
  at Python.Runtime.Runtime.Initialize()
  at Python.Runtime.PythonEngine.Initialize()
  at Python.Runtime.PythonConsole.Main(String[] args)

I have installed Python in C:\Python26.
Does any one an idea?

Is it necessary to use the python.exe build by the project or is it
also possible to use the original python executable?
When I try to use the original python executable I get the following error:
Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import clr
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
SystemError: dynamic module not initialized properly
>>>

Regards,
Bart
_________________________________________________
Python.NET mailing list - PythonDotNet@python.org
http://mail.python.org/mailman/listinfo/pythondotnet



--
oleksii