[Python.NET] Using Third Party C# Libraries
Maksim Kozyarchuk
mkozyarchuk at funddevelopmentservices.com
Tue Feb 20 18:19:33 CET 2007
Yes. The Assembly would be SharpNeatLib, in order for this to
work you need to place SharpNeatLib.dll into your PYTHON_PATH or the
GAC.
import CLR
from CLR.System.Reflection import Assembly
Assembly.LoadWithPartialName('SharpNeatLib')
from CLR.Name.Space import ClassName
Maksim
-----Original Message-----
From: Chris Spencer [mailto:chrisspen at gmail.com]
Sent: Tuesday, February 20, 2007 12:14 PM
To: Maksim Kozyarchuk
Cc: pythondotnet at python.org
Subject: Re: [Python.NET] Using Third Party C# Libraries
I'm assuming you meant I have to replace 'TheAssembly' with some
variation of SharpNeatLib.dll. Could you please be more specific? It
doesn't seem to work for any combination.
import CLR
from CLR.System.Reflection import Assembly
Assembly.LoadWithPartialName('SharpNeatLib')
import CLR.SharpNeatLib
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named SharpNeatLib
import CLR
from CLR.System.Reflection import Assembly
Assembly.LoadWithPartialName('SharpNeatLib.dll')
import CLR.SharpNeatLib
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named SharpNeatLib
import CLR
from CLR.System.Reflection import Assembly
Assembly.LoadWithPartialName('SharpNeat')
import CLR.SharpNeat
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named SharpNeat
Regards,
Chris
On 2/20/07, Maksim Kozyarchuk <mkozyarchuk at funddevelopmentservices.com>
wrote:
> Try the following syntax.
>
> import CLR
> from CLR.System.Reflection import Assembly
> Assembly.LoadWithPartialName('TheAssebly')
> from CLR.Name.Space import ClassName
>
>
>
>
>
> -----Original Message-----
> From: pythondotnet-bounces at python.org
> [mailto:pythondotnet-bounces at python.org] On Behalf Of Chris Spencer
> Sent: Tuesday, February 20, 2007 11:55 AM
> To: pythondotnet at python.org
> Subject: [Python.NET] Using Third Party C# Libraries
>
> Hi,
>
> I'm new to Python.Net, and I'd like to access a C# library (SharpNeat)
> from Python. I tried placing it's DLL (SharpNeatLib.dll) into
> C:\Program Files\PythonNet\Lib\site-packages but when I try to import
> it I get the error:
>
> >>> import SharpNeatLib
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> ImportError: dynamic module does not define init function
> (initSharpNeatLib)
>
> Is there something I'm doing wrong? Any help is appreciated.
>
> Thanks,
> Chris
> _________________________________________________
> Python.NET mailing list - PythonDotNet at python.org
> http://mail.python.org/mailman/listinfo/pythondotnet
>
More information about the PythonDotNet
mailing list