Skip to content

Unable to run tests post installation #447

@Kashyapdevesh

Description

@Kashyapdevesh

Hi RapidFuzz team,

I'm currently trying to run the tests after building the library from source, but I'm encountering a DLL load failed error on import. Below is a summary of my setup and the steps I followed.

Environment :

OS: Windows 11
Python: 3.12.11
Toolchain: msys2 with mingw-w64, ninja, cmake

What I Did:

  1. Installed the toolchain via MSYS2:
pacman -Syu
pacman -S mingw-w64-x86_64-toolchain cmake ninja
  1. Set the environment variables in PowerShell:
$env:CC = "C:\msys64\mingw64\bin\gcc.exe"
$env:CXX = "C:\msys64\mingw64\bin\g++.exe"
$env:PATH = "C:\msys64\mingw64\bin;$env:PATH"
  1. Cloned the repo and installed the library:
git clone --recursive https://github.com/rapidfuzz/rapidfuzz.git
cd rapidfuzz
pip install . --verbose

Result : Installation completed successfully.

  1. Installed test dependencies:
pip install pytest hypothesis

The Issue :

When I run the tests:

pytest -v tests

I get the following error:

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

Running:

Get-ChildItem -Recurse -Filter *.pyd

...returns nothing

Prior Attempt (MinGW)

Before switching to MSYS2, I tried using MinGW but the installation failed with a CMake error (The C compiler ... is not able to compile a simple test program). So I switched to MSYS2 and Ninja, which completed the install.

I’m not experienced with build systems, so I may be missing something obvious. Could you please advise the correct way to:

  1. Build the package locally (with C++ extensions),
  2. Ensure the compiled files are placed in the right location,
  3. Run the full test suite with pytest?

P.S.
If there are any recommended resources or documentation that explain RapidFuzz’s internal algorithms, data flow, or overall architecture, I’d greatly appreciate it if you could point me in that direction. My goal is to understand the library in-depth and potentially contribute in the future.

Thanks in advance for your support!

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