Skip to content

Windows wheel: DLL load failed while importing _sparsediffengine #15

@Ahsoka

Description

@Ahsoka

Hi all, I recently have been trying out the new DNLP solvers in CVXPY on Windows I have run into some trouble. At first I was getting a module not found error, so I installed SparseDiffPy. After installing and attempting to solve a DNLP problem and I am getting the following error:

File ...\cvxpy\reductions\solvers\nlp_solvers\diff_engine\c_problem.py", line 16
    from sparsediffpy import _sparsediffengine as _diffengine

File ...\sparsediffpy\__init__.py", line 17
    from sparsediffpy import _sparsediffengine

ImportError: DLL load failed while importing _sparsediffengine: The specified module could not be found.

On Windows, sparsediffpy installs successfully and _sparsediffengine.pyd exists, but importing it fails with:

ImportError: DLL load failed while importing _sparsediffengine: The specified module could not be found.

This happens before any CVXPY/DNLP problem is solved. The minimal failing reproducer is:

import sparsediffpy; from sparsediffpy import _sparsediffengine

Environment

OS: Windows 10/11, x86_64
Python: CPython 3.13 in conda environment
Package manager: pip inside conda
sparsediffpy versions tested:
0.4.0: fails
0.3.0: fails
0.2.2: fails
MSVC runtime: reinstalled latest Microsoft Visual C++ Redistributable x64, still fails


NOTE: This issue only appears on Windows 10, I tried on macOS with an M4 Pro and it worked with no issues. I'm thinking maybe the windows wheels on PyPI are somehow built incorrectly? I'm not sure.

Also it would be nice if this package was automatically installed with cvxpy because when I installed cvxpy this package was not automatically bundled thus leading to a ModuleNotFoundError. I installed cvxpy via conda and pip and in both cases sparsediffpy was not recognized as a dependency and automatically installed (for both macOS and Windows).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions