Editdistance is a Python library providing a fast, C++ and Cython-optimized implementation of the Levenshtein (edit) distance. It efficiently calculates the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one sequence into the other. The library is suitable for applications requiring high-performance string similarity calculations, such as fuzzy matching, data cleaning, and natural language processing. The current version is 0.8.1, but the project's GitHub repository has been archived, indicating it is no longer actively maintained by the owner.
pip install editdistanceVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to calculate the Levenshtein distance between two strings or two sequences of hashable objects using the `editdistance.eval()` function.
Be aware of the project's archived status. Consider alternative actively maintained libraries for new projects or if critical updates are required. For existing projects, pin the version to 'editdistance==0.8.1'.
Ensure you `pip install editdistance` (no underscore) and `import editdistance` (no underscore) to use the fast, Cython-backed implementation. Double-check your `requirements.txt` and import statements.
Upgrade to `editdistance==0.8.1` or newer to ensure correct calculations for all sequence lengths. If unable to upgrade, thoroughly test your application with long sequences on older versions.
Verify wheel availability for your specific Python version. If issues arise, consider creating a custom wheel or installing from a source distribution if build tools are available. Alternatively, constrain your Python version to those with available wheels or use a drop-in Python-only fallback if performance is not critical.
Ensure the package is correctly installed by running: `pip install editdistance`. If using a virtual environment, activate it first. Verify installation with `pip show editdistance`.
On Windows, install 'Microsoft C++ Build Tools' from Visual Studio's website. On Linux, install `build-essential` (e.g., `sudo apt-get install build-essential`). On macOS, install Xcode Command Line Tools (`xcode-select --install`).
Rename any local files or directories named `editdistance.py` or `editdistance` to avoid conflicts. Verify the correct package is installed and accessible by checking `pip show editdistance` and inspecting `sys.path` to ensure no conflicting paths are listed before the site-packages directory.
Ensure your Python version is compatible (e.g., Python >=3.8 for recent `editdistance` versions). If wheels are unavailable, you'll need a C++ compiler installed (as described for the 'Microsoft Visual C++' error). Consider using a virtual environment to manage dependencies or explicitly specifying an older `editdistance` version if known to have wheels for your setup (e.g., `pip install editdistance==0.8.0`).
Install "Build Tools for Visual Studio" from Microsoft's website and ensure the "Desktop development with C++" workload is selected.
No dependency data recorded yet.