Trying to build Python extension (module) with Dlang and pyd with dub + ldc2

stpettersens s.stpettersen+github at gmail.com
Sat Nov 15 15:37:24 UTC 2025


I solved it. Just needed to install latest version of PyD which 
is not on PyPI:

``uv pip install git+https://github.com/ariovistus/pyd.git``

``uv pip install setuptools``

Then run ``python setup.py build_ext --inplace`` on script like 
so:

```py
import os
from pyd.support import setup, Extension

module = Extension(
     "hello",
     sources=[os.path.join('source', 'hello.d'],
     build_deimos=True,
     d_lump=True,
     extra_compile_args=['-verrors=0', '-wi']
)

setup(
     name="hello",
     version="1.0",
     ext_modules=[module]
)
```


More information about the Digitalmars-d-learn mailing list