0

Getting following error while installing hunspell:-

PS C:\Users\SHREYA ANANYA> pip install hunspell
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/hunspell/
Collecting hunspell
  Using cached hunspell-0.5.5.tar.gz (34 kB)
  Preparing metadata (setup.py) ... done
Installing collected packages: hunspell
  DEPRECATION: hunspell is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for hunspell ... error
  error: subprocess-exited-with-error

  × Running setup.py install for hunspell did not run successfully.
  │ exit code: 1
  ╰─> [7 lines of output]
      running install
      C:\Python311\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_ext
      building 'hunspell' 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.
╰─> hunspell

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

Above is a snippet of error I an getting. How do I solve this problem?

Shreya
  • 1
  • Wecome to Stack Overflow. The root error appears to be **"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/ "** Are you running MS VC++ v14.0 or greater? If not, well apparently you need to be to install what you're trying to install. – CryptoFool Nov 12 '22 at 11:40
  • Thankyou for the solution but the problem is still not resolved – Shreya Nov 13 '22 at 14:22
  • cl : Command line warning D9025 : overriding '/MD' with '/MT' hunspell.cpp C:\Python311\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2 – Shreya Nov 13 '22 at 14:24
  • cl : Command line warning D9025 : overriding '/MD' with '/MT' hunspell.cpp C:\Python311\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2 – Shreya Nov 13 '22 at 14:24
  • There's a SO question about that one that will hopefully lead you to a solution to this problem: https://stackoverflow.com/questions/40018405/cannot-open-include-file-io-h-no-such-file-or-directory – CryptoFool Nov 13 '22 at 16:28

1 Answers1

0

I tried this and it's work for me

    sudo apt-get update
    sudo apt-get install libhunspell-dev
    python -m pip install hunspell
OR
    python3 -m pip install hunspell
  • While this code snippet may be the solution, including a detailed explanation really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion. – Shawn Hemelstrand Feb 26 '23 at 03:28