Установка пакета hunspell

Я с нетерпением жду установки пакета hunspell с помощью pip, но он выдает следующую ошибку:

Collecting hunspell
  Using cached hunspell-0.4.1.tar.gz
Building wheels for collected packages: hunspell
  Running setup.py bdist_wheel for hunspell ... error
  Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-oyfpp3iy/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 /tmp/tmphqvqt4lxpip-wheel- --python-tag cp34:
  /root/anaconda3/lib/python3.4/distutils/extension.py:132: UserWarning: Unknown Extension options: 'compile_args', 'macros'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_ext
  building 'hunspell' extension
  creating build
  creating build/temp.linux-x86_64-3.4
  gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/hunspell -I/root/anaconda3/include/python3.4m -c hunspell.c -o build/temp.linux-x86_64-3.4/hunspell.o
  hunspell.c:21:22: erreur fatale: hunspell.h : Aucun fichier ou dossier de ce type
   #include <hunspell.h>
                        ^
  compilation terminée.
  error: command 'gcc' 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 /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-oyfpp3iy/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 /tmp/pip-euhsmasb-record/install-record.txt --single-version-externally-managed --compile:
    /root/anaconda3/lib/python3.4/distutils/extension.py:132: UserWarning: Unknown Extension options: 'compile_args', 'macros'
      warnings.warn(msg)
    running install
    running build
    running build_ext
    building 'hunspell' extension
    creating build
    creating build/temp.linux-x86_64-3.4
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/hunspell -I/root/anaconda3/include/python3.4m -c hunspell.c -o build/temp.linux-x86_64-3.4/hunspell.o
    hunspell.c:21:22: erreur fatale: hunspell.h : Aucun fichier ou dossier de ce type
     #include <hunspell.h>
                          ^
    compilation terminée.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-oyfpp3iy/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 /tmp/pip-euhsmasb-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-oyfpp3iy/hunspell/
[root@localhost Bureau]# alias python-devel=python34-devel
[root@localhost Bureau]# pip install hunspell
Collecting hunspell
  Using cached hunspell-0.4.1.tar.gz
Building wheels for collected packages: hunspell
  Running setup.py bdist_wheel for hunspell ... error
  Complete output from command /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-xpljhkom/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 /tmp/tmptwg_9c8vpip-wheel- --python-tag cp34:
  /root/anaconda3/lib/python3.4/distutils/extension.py:132: UserWarning: Unknown Extension options: 'compile_args', 'macros'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_ext
  building 'hunspell' extension
  creating build
  creating build/temp.linux-x86_64-3.4
  gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/hunspell -I/root/anaconda3/include/python3.4m -c hunspell.c -o build/temp.linux-x86_64-3.4/hunspell.o
  hunspell.c:21:22: erreur fatale: hunspell.h : Aucun fichier ou dossier de ce type
   #include <hunspell.h>
                        ^
  compilation terminée.
  error: command 'gcc' 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 /root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-xpljhkom/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 /tmp/pip-zrlp2go9-record/install-record.txt --single-version-externally-managed --compile:
    /root/anaconda3/lib/python3.4/distutils/extension.py:132: UserWarning: Unknown Extension options: 'compile_args', 'macros'
      warnings.warn(msg)
    running install
    running build
    running build_ext
    building 'hunspell' extension
    creating build
    creating build/temp.linux-x86_64-3.4
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/hunspell -I/root/anaconda3/include/python3.4m -c hunspell.c -o build/temp.linux-x86_64-3.4/hunspell.o
    hunspell.c:21:22: erreur fatale: hunspell.h : Aucun fichier ou dossier de ce type
     #include <hunspell.h>
                          ^
    compilation terminée.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/root/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-xpljhkom/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 /tmp/pip-zrlp2go9-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-xpljhkom/hunspell/

И я слышал, что установка python3-dev решит проблему. Я пытался без успеха. Я использую python 3.4 под CentOS 7. Могу ли я получить помощь, пожалуйста? Заранее спасибо.


person ABK    schedule 03.05.2017    source источник
comment
Покажите полный лог ошибки, пожалуйста.   -  person dikkini    schedule 03.05.2017
comment
Я переместил ваше решение в вики-ответ сообщества.   -  person Cœur    schedule 01.08.2017


Ответы (3)


Я только что прошел через это, используя python3.4 и pip3.4 на 64-разрядной версии Centos7. (NB вам нужны как python3.4, так и pip3.4)

В конце концов я заставил его работать через pip3.4, но прежде чем это заработало, мне пришлось сделать несколько дополнительных шагов. Шаги, которые я предпринял, были следующими:

Установите заголовки разработки python3.4:

sudo yum install python34u-devel.x86_64

Установите hunspell и hunspell-devel (необходимы для hunspell.h и hunspell lib):

sudo yum install hunspell hunspell-devel

В /usr/lib64/ добавьте дополнительную символическую ссылку на библиотеку hunspell:

sudo ln -s libhunspell-1.3.so libhunspell.so

Наконец, запустите команду:

sudo pip3.4 install hunspell

... и это дало мне следующий результат:

... (compiler output deleted) ...
Successfully built hunspell
Installing collected packages: hunspell
Successfully installed hunspell-0.4.1
person AS Mackay    schedule 03.05.2017

Попробуй это:

sudo apt install python-dev libhunspell-dev
pip install hunspell
person SAIF AHMAD KHAN    schedule 29.04.2019
comment
Для python3 я использовал: sudo apt install python3-dev libhunspell-dev и pip3 install hunspell. - person vlz; 22.08.2019

Решение от OP.

Я разобрался, поделюсь этим методом здесь, может поможет :) сначала нужно установить python-devel и

yum install python-devel  
yum install hunspell-devel  

затем исправил вашу симлинк

cd /usr/lib64
sudo ln -s libhunspell-1.3.so.0.0.0 libhunspell.so
ls -l | grep hunspell

Удачи :)

person Community    schedule 01.08.2017