Building wheel for fasttext (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [20 lines of output]
D:\python\lib\site-packages\setuptools\dist.py:742: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
% (opt, underscore_opt)
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\fasttext
copying python\fasttext_module\fasttext\FastText.py -> build\lib.win-amd64-3.7\fasttext
copying python\fasttext_module\fasttext\__init__.py -> build\lib.win-amd64-3.7\fasttext
creating build\lib.win-amd64-3.7\fasttext\util
copying python\fasttext_module\fasttext\util\util.py -> build\lib.win-amd64-3.7\fasttext\util
copying python\fasttext_module\fasttext\util\__init__.py -> build\lib.win-amd64-3.7\fasttext\util
creating build\lib.win-amd64-3.7\fasttext\tests
copying python\fasttext_module\fasttext\tests\test_configurations.py -> build\lib.win-amd64-3.7\fasttext\tests
copying python\fasttext_module\fasttext\tests\test_script.py -> build\lib.win-amd64-3.7\fasttext\tests
copying python\fasttext_module\fasttext\tests\__init__.py -> build\lib.win-amd64-3.7\fasttext\tests
running build_ext
building 'fasttext_pybind' 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 fasttext
Running setup.py clean for fasttext
Failed to build fasttext
WARNING: Ignoring invalid distribution -ip (d:\python\lib\site-packages)
Installing collected packages: fasttext, paddleocr
Running setup.py install for fasttext ... error
error: subprocess-exited-with-error
× Running setup.py install for fasttext did not run successfully.
│ exit code: 1
╰─> [22 lines of output]
D:\python\lib\site-packages\setuptools\dist.py:742: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
% (opt, underscore_opt)
running install
D:\python\lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\fasttext
copying python\fasttext_module\fasttext\FastText.py -> build\lib.win-amd64-3.7\fasttext
copying python\fasttext_module\fasttext\__init__.py -> build\lib.win-amd64-3.7\fasttext
creating build\lib.win-amd64-3.7\fasttext\util
copying python\fasttext_module\fasttext\util\util.py -> build\lib.win-amd64-3.7\fasttext\util
copying python\fasttext_module\fasttext\util\__init__.py -> build\lib.win-amd64-3.7\fasttext\util
creating build\lib.win-amd64-3.7\fasttext\tests
copying python\fasttext_module\fasttext\tests\test_configurations.py -> build\lib.win-amd64-3.7\fasttext\tests
copying python\fasttext_module\fasttext\tests\test_script.py -> build\lib.win-amd64-3.7\fasttext\tests
copying python\fasttext_module\fasttext\tests\__init__.py -> build\lib.win-amd64-3.7\fasttext\tests
running build_ext
building 'fasttext_pybind' 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.
╰─> fasttext
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
WARNING: Ignoring invalid distribution -ip (d:\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\python\lib\site-packages)
错误原因:这是因为未安装Microsoft Visual C++ 14.0,安装方法见知乎: