安装hunspell时出现以下错误:-
PS C:UsersSHREYA 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:Python311Libsite-packagessetuptoolscommandinstall.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.
上面是我得到的一个错误片段。如何解决这个问题?我试过了,它为我工作
sudo apt-get update
sudo apt-get install libhunspell-dev
python -m pip install hunspell
OR
python3 -m pip install hunspell