{"id":5614,"library":"editdistance","title":"Editdistance","description":"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.","status":"abandoned","version":"0.8.1","language":"python","source_language":"en","source_url":"https://github.com/roy-ht/editdistance","tags":["edit distance","levenshtein distance","string similarity","algorithm","fuzzy matching","cython","performance"],"install":[{"cmd":"pip install editdistance","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"The primary function `eval` is accessed directly from the imported `editdistance` module, not as a class instance.","wrong":"from editdistance import editdistance","symbol":"eval","correct":"import editdistance\neditdistance.eval('string1', 'string2')"}],"quickstart":{"code":"import editdistance\n\n# Calculate edit distance between two strings\ndistance = editdistance.eval('kitten', 'sitting')\nprint(f\"Edit distance between 'kitten' and 'sitting': {distance}\")\n\n# Works with any iterable of hashable objects (e.g., lists of words)\ndistance_list = editdistance.eval(['spam', 'egg'], ['spam', 'ham'])\nprint(f\"Edit distance between ['spam', 'egg'] and ['spam', 'ham']: {distance_list}\")","lang":"python","description":"This example demonstrates how to calculate the Levenshtein distance between two strings or two sequences of hashable objects using the `editdistance.eval()` function."},"warnings":[{"fix":"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'.","message":"The GitHub repository for `editdistance` (roy-ht/editdistance) was archived by the owner on June 30, 2025, making it read-only. This indicates that the library is no longer under active development or maintenance by its original creator, and new features or bug fixes are unlikely to be released.","severity":"breaking","affected_versions":"All versions post-June 2025"},{"fix":"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.","message":"A separate, pure-Python library named `edit_distance` (with an underscore) exists on PyPI. It has a different API, is typically slower, and is not the C++/Cython optimized `editdistance` library. Importing the wrong one is a common mistake.","severity":"gotcha","affected_versions":"All versions"},{"fix":"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.","message":"Versions prior to `0.8.0` might produce incorrect results for very long sequences (e.g., those with length > 640) due to a bug that was fixed in version `0.8.0`.","severity":"gotcha","affected_versions":"<0.8.0"},{"fix":"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.","message":"As of November 2023, `editdistance` version 0.8.1 did not have compatible binary wheels for Python 3.13 (cp313), potentially leading to installation failures in strict wheelhouse environments or requiring a build from source, which might have additional dependencies.","severity":"gotcha","affected_versions":"0.8.1 on Python 3.13+"}],"env_vars":null,"search_vec":"'0.8.1':71 'activ':86 'algorithm':97 'applic':49 'archiv':80 'c':10 'calcul':23,56 'chang':38 'charact':30 'clean':62 'current':68 'cython':13,100 'cython-optim':12 'data':61 'delet':33 'distanc':20,92,94 'edit':19,31,91 'editdist':1,2 'effici':22 'fast':9 'fuzzi':59,98 'github':76 'high':52 'high-perform':51 'implement':15 'indic':81 'insert':32 'languag':65 'levenshtein':18,93 'librari':6,45 'longer':85 'maintain':87 'match':60,99 'minimum':25 'natur':64 'number':26 'one':39 'optim':14 'owner':90 'perform':53,101 'process':66 'project':74 'provid':7 'python':5 'repositori':77 'requir':36,50 'sequenc':40 'similar':55,96 'singl':29 'single-charact':28 'string':54,95 'substitut':35 'suitabl':47 'version':69","created_at":"2026-04-14T03:36:16.558063+00:00","updated_at":"2026-04-17T15:16:52.894980+00:00","problems":[{"fix":"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`.","cause":"This error occurs when the 'editdistance' package is not installed in the active Python environment or is installed incorrectly, so the Python interpreter cannot find it.","error":"ModuleNotFoundError: No module named 'editdistance'"},{"fix":"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`).","cause":"The 'editdistance' library is implemented in C++/Cython and requires a C++ compiler (like Visual C++ Build Tools on Windows or GCC on Linux/macOS) to compile from source if a pre-compiled wheel isn't available for your specific Python version and operating system.","error":"ERROR: Microsoft Visual C++ 14.0 or greater is required."},{"fix":"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.","cause":"This error usually means there's a name collision, where another file or module named 'editdistance.py' exists in your Python path, shadowing the actual installed 'editdistance' package. It can also occur if the installation is corrupted or an older version is present.","error":"AttributeError: module 'editdistance' has no attribute 'eval'"},{"fix":"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`).","cause":"This issue arises when `pip` cannot find a compatible pre-built binary wheel for your specific Python version and operating system, often leading back to the need to compile from source, which then requires C++ build tools.","error":"ERROR: Could not find a version that satisfies the requirement editdistance"},{"fix":"Install \"Build Tools for Visual Studio\" from Microsoft's website and ensure the \"Desktop development with C++\" workload is selected.","cause":"Installing editdistance requires compiling C++ extensions, and the necessary C++ build tools are not installed on your Windows system.","error":"error: Microsoft Visual C++ 14.0 is required. Get it with \"Build Tools for Visual Studio\": https://visualstudio.microsoft.com/downloads/"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.8.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/roy-ht/editdistance","docs":"https://github.com/roy-ht/editdistance","changelog":null,"pypi":"https://pypi.org/project/editdistance/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}