Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Cannot install editdistance for Python 3.13 on Windows #116

@joanise

Description

@joanise

I'm sorry to report that the Windows issue just keeps coming back.

Noticed recently by a user of our project, (see ReadAlongs/Studio#276): trying to install editdistance on Windows with Python 3.13.5 produces error messages.

On my local machine, even though I have MSBuildTools installed, I get an error message saying I should install it, like what's shown in ReadAlongs/Studio#276.

In GitHub Actions, starting with Python 3.13.4, with a windows-latest runner, I get the following much more detailed error message:

Building wheel for editdistance (pyproject.toml): started
  Building wheel for editdistance (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  Building wheel for editdistance (pyproject.toml) did not run successfully.
  exit code: 1
  
  [125 lines of output]
  Compiling src/editdistance/bycython.pyx because it changed.
  [1/1] Cythonizing src/editdistance/bycython.pyx
  C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bmp4on9m\normal\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated
  !!
  
          ********************************************************************************
          Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0).
  
          By 2026-Feb-18, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.
  
          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************
  
  !!
    corresp(dist, value, root_dir)
  running build
  running build_py
  creating C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\lib.win-amd64-cpython-313\editdistance
  copying src\editdistance\__init__.py -> C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\lib.win-amd64-cpython-313\editdistance
  running egg_info
  creating src\editdistance.egg-info
  writing src\editdistance.egg-info\PKG-INFO
  writing dependency_links to src\editdistance.egg-info\dependency_links.txt
  writing top-level names to src\editdistance.egg-info\top_level.txt
  writing manifest file 'src\editdistance.egg-info\SOURCES.txt'
  reading manifest file 'src\editdistance.egg-info\SOURCES.txt'
  adding license file 'LICENSE'
  writing manifest file 'src\editdistance.egg-info\SOURCES.txt'
  copying src\editdistance\__init__.pxd -> C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\lib.win-amd64-cpython-313\editdistance
  copying src\editdistance\_editdistance.cpp -> C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\lib.win-amd64-cpython-313\editdistance
  copying src\editdistance\_editdistance.h -> C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\lib.win-amd64-cpython-313\editdistance
  copying src\editdistance\bycython.cpp -> C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\lib.win-amd64-cpython-313\editdistance
  copying src\editdistance\bycython.pxd -> C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\lib.win-amd64-cpython-313\editdistance
  copying src\editdistance\bycython.pyx -> C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\lib.win-amd64-cpython-313\editdistance
  copying src\editdistance\def.h -> C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\lib.win-amd64-cpython-313\editdistance
  copying src\editdistance\__init__.py -> C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\lib.win-amd64-cpython-313\editdistance
  running build_ext
  building 'editdistance.bycython' extension
  creating C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\temp.win-amd64-cpython-313\Release\src\editdistance
  "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Isrc/editdistance -IC:\hostedtoolcache\windows\Python\3.13.4\x64\include -IC:\hostedtoolcache\windows\Python\3.13.4\x64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpsrc/editdistance/_editdistance.cpp /FoC:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\temp.win-amd64-cpython-313\Release\src\editdistance\_editdistance.obj
  _editdistance.cpp
  src/editdistance/_editdistance.cpp(69): warning C4267: '=': conversion from 'size_t' to '_Ty', possible loss of data
          with
          [
              _Ty=uint32_t
          ]
  src/editdistance/_editdistance.cpp(114): warning C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
  src/editdistance/_editdistance.cpp(114): note: the template instantiation context (the oldest one first) is
  src/editdistance/_editdistance.cpp(142): note: see reference to function template instantiation 'unsigned int edit_distance_map_<1>(const int64_t *,const size_t,const int64_t *,const size_t)' being compiled
  src/editdistance/_editdistance.cpp(115): warning C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
  src/editdistance/_editdistance.cpp(84): warning C4267: '=': conversion from 'size_t' to '_Ty', possible loss of data
          with
          [
              _Ty=uint32_t
          ]
  src/editdistance/_editdistance.cpp(84): note: the template instantiation context (the oldest one first) is
  src/editdistance/_editdistance.cpp(173): note: see reference to function template instantiation 'bool edit_distancec_dp<int64_t>(const T *,const size_t,const T *,const size_t,const unsigned int)' being compiled
          with
          [
              T=int64_t
          ]
  "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Isrc/editdistance -IC:\hostedtoolcache\windows\Python\3.13.4\x64\include -IC:\hostedtoolcache\windows\Python\3.13.4\x64\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpsrc/editdistance/bycython.cpp /FoC:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\temp.win-amd64-cpython-313\Release\src\editdistance\bycython.obj
  bycython.cpp
  src/editdistance/bycython.cpp(2495): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'const unsigned int', possible loss of data
  src/editdistance/bycython.cpp(2495): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'const unsigned int', possible loss of data
  src/editdistance/bycython.cpp(2537): warning C4309: '=': truncation of constant value
  src/editdistance/bycython.cpp(2777): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'const unsigned int', possible loss of data
  src/editdistance/bycython.cpp(2777): warning C4244: 'argument': conversion from 'Py_ssize_t' to 'const unsigned int', possible loss of data
  src/editdistance/bycython.cpp(2819): warning C4309: '=': truncation of constant value
  src/editdistance/bycython.cpp(3106): warning C4309: '=': truncation of constant value
  src/editdistance/bycython.cpp(7228): warning C4551: function call missing argument list
  src/editdistance/bycython.cpp(7235): warning C4551: function call missing argument list
  "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\hostedtoolcache\windows\Python\3.13.4\x64\libs /LIBPATH:C:\hostedtoolcache\windows\Python\3.13.4\x64 /LIBPATH:C:\hostedtoolcache\windows\Python\3.13.4\x64\PCbuild\amd64 "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.26100.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.26100.0\\um\x64" /EXPORT:PyInit_bycython C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\temp.win-amd64-cpython-313\Release\src\editdistance\_editdistance.obj C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\temp.win-amd64-cpython-313\Release\src\editdistance\bycython.obj /OUT:C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\lib.win-amd64-cpython-313\editdistance\bycython.cp313-win_amd64.pyd /IMPLIB:C:\Users\RUNNER~1\AppData\Local\Temp\pdm-build-y8mczyjp\temp.win-amd64-cpython-313\Release\src\editdistance\bycython.cp313-win_amd64.lib
  LINK : fatal error LNK1104: cannot open file 'python313t.lib'
  error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.43.34808\\bin\\HostX86\\x64\\link.exe' failed with exit code 1104
  Traceback (most recent call last):
    File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bmp4on9m\overlay\Lib\site-packages\pdm\backend\hooks\setuptools.py", line 90, in _build_lib
      subprocess.check_call(build_args)
      ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
    File "C:\hostedtoolcache\windows\Python\3.13.4\x64\Lib\subprocess.py", line 419, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['C:\\hostedtoolcache\\windows\\Python\\3.13.4\\x64\\python.exe', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pip-install-n0cjm49n\\editdistance_86d856f6e11844d3a7003ea90527aea3\\setup.py', 'build', '-b', 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\pdm-build-y8mczyjp']' returned non-zero exit status 1.
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "C:\hostedtoolcache\windows\Python\3.13.4\x64\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line [389](https://github.com/ReadAlongs/Studio/actions/runs/15760134023/job/44424605787#step:5:390), in <module>
      main()
      ~~~~^^
    File "C:\hostedtoolcache\windows\Python\3.13.4\x64\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main
      json_out["return_val"] = hook(**hook_input["kwargs"])
                               ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\hostedtoolcache\windows\Python\3.13.4\x64\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 280, in build_wheel
      return _build_backend().build_wheel(
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
          wheel_directory, config_settings, metadata_directory
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      )
      ^
    File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bmp4on9m\overlay\Lib\site-packages\pdm\backend\__init__.py", line 55, in build_wheel
      return builder.build(
             ~~~~~~~~~~~~~^
          wheel_directory, metadata_directory=metadata_directory
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      ).name
      ^
    File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bmp4on9m\overlay\Lib\site-packages\pdm\backend\base.py", line 227, in build
      files = sorted(self.get_files(context))
    File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bmp4on9m\overlay\Lib\site-packages\pdm\backend\wheel.py", line 121, in get_files
      yield from super().get_files(context)
                 ~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bmp4on9m\overlay\Lib\site-packages\pdm\backend\base.py", line 200, in get_files
      self.call_hook("pdm_build_update_files", context, files)
      ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bmp4on9m\overlay\Lib\site-packages\pdm\backend\base.py", line 151, in call_hook
      getattr(hook, hook_name)(context, *args, **kwargs)
      ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bmp4on9m\overlay\Lib\site-packages\pdm\backend\hooks\setuptools.py", line 82, in pdm_build_update_files
      self._build_lib(context)
      ~~~~~~~~~~~~~~~^^^^^^^^^
    File "C:\Users\runneradmin\AppData\Local\Temp\pip-build-env-bmp4on9m\overlay\Lib\site-packages\pdm\backend\hooks\setuptools.py", line 92, in _build_lib
      raise BuildError(f"Error occurs when running {build_args}:\n{e}")
  pdm.backend.exceptions.BuildError: Error occurs when running ['C:\\hostedtoolcache\\windows\\Python\\3.13.4\\x64\\python.exe', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pip-install-n0cjm49n\\editdistance_86d856f6e11844d3a7003ea90527aea3\\setup.py', 'build', '-b', 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\pdm-build-y8mczyjp']:
  Command '['C:\\hostedtoolcache\\windows\\Python\\3.13.4\\x64\\python.exe', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pip-install-n0cjm49n\\editdistance_86d856f6e11844d3a7003ea90527aea3\\setup.py', 'build', '-b', 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\pdm-build-y8mczyjp']' returned non-zero exit status 1.
  [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for editdistance
  Building wheel for unicodecsv (pyproject.toml): started
  Building wheel for unicodecsv (pyproject.toml): finished with status 'done'
  Created wheel for unicodecsv: filename=unicodecsv-0.14.1-py3-none-any.whl size=10806 sha256=0a2cd0a6ae3f5286f79c4f2f8af0087ae55de6575[401](https://github.com/ReadAlongs/Studio/actions/runs/15760134023/job/44424605787#step:5:402)b777c48b636c39b41ed6
  Stored in directory: c:\users\runneradmin\appdata\local\pip\cache\wheels\c3\9a\3f\f155a0a82b3136dd4028a8e99d72ec8d8c33fb15477a0eacb7
Successfully built readalongs unicodecsv
Failed to build editdistance
ERROR: Failed to build installable wheels for some pyproject.toml based projects (editdistance)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions