我想在pip3上安装hunspell时出现gcc问题

时间:2019-05-16 13:43:29

标签: macos gcc pip homebrew hunspell

我正在Mac OS上工作。 我使用了“ brew install hunspell”,但是现在我遇到了使“ pip3 install hunspell”出现问题的问题

我尝试执行brew install gcc,但确实可以解决问题。

MacBook:bin $ pip3 install hunspell
Collecting hunspell
Using cached https://files.pythonhosted.org/packages/e5/fe/cfc4dfd92c3a37c34d2806d5b84f9981bf3520db20149f8ee1a61f6fc69d/hunspell-0.5.5.tar.gz
Building wheels for collected packages: hunspell
Building wheel for hunspell (setup.py) ... error
Complete output from command /usr/local/opt/python/bin/python3.7 -u -c"importsetuptools,tokenize;__file__='/private/var/folders/ty/z084vbf1137qft9t7nmh8xr0000gq/T/pip-install-f00b6zkx/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/ty/z084vbf1137cqft9t7nmh8xr0000gq/T/pip-wheel-ssonog8z --python-tag cp37:
running bdist_wheel
running build
running build_ext
building 'hunspell' extension
creating build
creating build/temp.macosx-10.14-x86_64-3.7
/usr/local/bin/gcc-6 -DNDEBUG -g -fwrapv -O3 -Wall -Wa,-q -D_LINUX -I/usr/local/Cellar/hunspell/1.6.2/include/hunspell -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c hunspell.cpp -o build/temp.macosx-10.14-x86_64-3.7/hunspell.o -Wall
unable to execute '/usr/local/bin/gcc-6': No such file or directory
error: command '/usr/local/bin/gcc-6' failed with exit status 1

----------------------------------------
Failed building wheel for hunspell
Running setup.py clean for hunspell
Failed to build hunspell
Installing collected packages: hunspell
Running setup.py install for hunspell ... error
Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/ty/z084vbf1137cqft9t7nmh8xr0000gq/T/pip-install-f00b6zkx/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/ty/z084vbf1137cqft9t7nmh8xr0000gq/T/pip-record-7vvt6eyr/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'hunspell' extension
creating build
creating build/temp.macosx-10.14-x86_64-3.7
/usr/local/bin/gcc-6 -DNDEBUG -g -fwrapv -O3 -Wall -Wa,-q -D_LINUX -I/usr/local/Cellar/hunspell/1.6.2/include/hunspell -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c hunspell.cpp -o build/temp.macosx-10.14-x86_64-3.7/hunspell.o -Wall
unable to execute '/usr/local/bin/gcc-6': No such file or directory
error: command '/usr/local/bin/gcc-6' failed with exit status 1

----------------------------------------
Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/ty/z084vbf1137cqft9t7nmh8xr0000gq/T/pip-install-f00b6zkx/hunspell/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/ty/z084vbf1137cqft9t7nmh8xr0000gq/T/pip-record-7vvt6eyr/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/ty/z084vbf1137cqft9t7nmh8xr0000gq/T/pip-install-f00b6zkx/hunspell/

1 个答案:

答案 0 :(得分:0)

您必须使用以下命令安装gcc 6

brew install gcc@6