How can I import a .PYD module in IronPython?

后端 未结 2 1567
栀梦
栀梦 2020-12-20 05:41

I\'m trying to use a python package from IronPython. Everything works fine if I import regular python modules.

But when I try to do the following:

im         


        
相关标签:
2条回答
  • 2020-12-20 05:47

    You can check out IronClad which is working to provide this support. It may or may not work w/ your PYD of choice.

    0 讨论(0)
  • 2020-12-20 06:07

    A .pyd file is a DLL. So unless IronPython (which is written in .net) can correctly load C DLLs written for CPython, you might be out of luck.


    Update

    In fact, according to the IronPython FAQ, you are unfortunately unable to import .pyd files:

    Q: How do I build and call into PYD libraries?

    A: IronPython does not support using PYDs built for CPython since they leverage implementation details of CPython. You can get a similar effect for new "PYD"s you would like to implement by writing them in C# or VB and building a DLL for .NET.

    0 讨论(0)
提交回复
热议问题