Skip to content

ImportError: DLL load failed while importing (...) #1152

@test3211234

Description

@test3211234

Coming from here. If I use pybind11's setup.py with setup.py install and no scikit build everything works perfectly. When I switch to scikit-build-core following this, though, it builds fine but when I import my module in a script I get the error:

Traceback (most recent call last):
  File "C:\Users\PC\Documents\dev\projects\3DRT\rasterizer.py", line 18, in <module>
    import renderer
  File "C:\Users\PC\Documents\dev\projects\3DRT\renderer\src\renderer\__init__.py", line 1, in <module>
    from .renderer_ext import Renderer, Render
ImportError: DLL load failed while importing renderer_ext: The specified module could not be found.

What's going on here? Here's my file structure:

.
└── renderer/
    ├── src/
    │   ├── renderer/
    │   │   └── __init__.py
    │   └── renderer_ext.cpp
    ├── pyproject.toml
    └── CMakeLists.txt

init.py looks like:

from .renderer_ext import Renderer, Render

__all__ = ["Renderer", "Render"]

and CMakeLists is the regular:

find_package(Python 3.10 REQUIRED COMPONENTS Interpreter Development.Module)
find_package(nanobind CONFIG REQUIRED)

(...)

install(TARGETS renderer_ext LIBRARY DESTINATION renderer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions