[Python.NET] C# assembly module importing error using pythonnet after .py to .pyd conversion.

Weichen Lin kennywc.lin at gmail.com
Sun Nov 24 04:55:13 EST 2019

Dear Sir,


Thank you for your effort in developing a wonderful module pythonnet so that
I can easily interface

the C# assembly

offered by my futures dealer.


A working simple code is as follows, using the supplied assembly in


# File name: Test.py

import clr


import Intelligence

QC = Intelligence.QuoteCom("", 8000, "API", "b6eb")


However, it caused an error importing "Intelligence" module when I converted
.py to .pyd.



Conversion was done using:


# setup.py

from distutils.core import setup

from distutils.extension import Extension

from Cython.Distutils import build_ext

ext_modules = [

    Extension("Test", sources=["Test.py"]),




    name = 'My Program',

    cmdclass = {'build_ext': build_ext},

    ext_modules = ext_modules



# DOS command:

Python setup.py build_ext -inplace


Is there any step I've done wrong?


Any response is appreciated.

Thank you very much!


Best regards,

Weichen Lin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20191124/ff38cdd8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 158249 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20191124/ff38cdd8/attachment-0001.jpg>

More information about the PythonDotNet mailing list