Skip to content

[BUG] Windows users with Python 3.8+ cannot resolve editdistance==0.5.3 dependency #79

@tpanza

Description

@tpanza

Describe the bug
A Windows user running Python 3.8 or 3.9 cannot successfully run pip install contextualSpellCheck. (Unless Microsoft C++ Build Tools has been installed ahead of time.)

To Reproduce

conda create -n myenv python=3.9
conda activate myenv
python -m pip install contextualSpellCheck

Building wheels for collected packages: editdistance
  Building wheel for editdistance (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-39
      creating build\lib.win-amd64-cpython-39\editdistance
      copying editdistance\__init__.py -> build\lib.win-amd64-cpython-39\editdistance
      copying editdistance\_editdistance.h -> build\lib.win-amd64-cpython-39\editdistance
      copying editdistance\def.h -> build\lib.win-amd64-cpython-39\editdistance
      running build_ext
      building 'editdistance.bycython' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for editdistance
  Running setup.py clean for editdistance
Failed to build editdistance
Installing collected packages: editdistance, contextualSpellCheck
  Running setup.py install for editdistance ... error
  error: subprocess-exited-with-error

  × Running setup.py install for editdistance did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      running install
      C:\Users\sv182c\work\mambaforge\envs\bellablue\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-39
      creating build\lib.win-amd64-cpython-39\editdistance
      copying editdistance\__init__.py -> build\lib.win-amd64-cpython-39\editdistance
      copying editdistance\_editdistance.h -> build\lib.win-amd64-cpython-39\editdistance
      copying editdistance\def.h -> build\lib.win-amd64-cpython-39\editdistance
      running build_ext
      building 'editdistance.bycython' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> editdistance

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Expected behavior
Installation to succeed on Windows for Python 3.8 or 3.9, without having to install Microsoft C++ Build Tools.

Version (please complete the following information):

  • contextualSpellCheck 0.4.2
  • Spacy: 3.4.1
  • transformers 4.21.1

Additional information

The setup.py script for contextualSpellCheck has its editdistance dependency pinned to version 0.5.3. That release of editdistance only has prebuilt binary wheels for up to Python 3.7.

A newer release of editdistance, 0.6.0, contains no code changes but includes binary wheels for more versions of Python (up to 3.9).

So if the editdistance dependency version were simply relaxed to something like >= 0.5.3 or ~= 0.5, then pip would find the 0.6.0 release and use those pre-built binary wheels. Since there are no underlying code changes to that release of editdistance, that would be a simple and low-risk change for contextualSpellCheck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions