Installing hunspell package

2024/10/6 4:05:38

I'm looking forward to install the hunspell package using pip, but it throws the following error:

Collecting hunspellUsing cached hunspell-0.4.1.tar.gz
Building wheels for collected packages: hunspellRunning setup.py bdist_wheel for hunspell ... errorComplete 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_wheelrunning buildrunning build_extbuilding 'hunspell' extensioncreating buildcreating build/temp.linux-x86_64-3.4gcc -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.ohunspell.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 hunspellRunning setup.py clean for hunspell
Failed to build hunspell
Installing collected packages: hunspellRunning setup.py install for hunspell ... errorComplete 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 installrunning buildrunning build_extbuilding 'hunspell' extensioncreating buildcreating build/temp.linux-x86_64-3.4gcc -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.ohunspell.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 hunspellUsing cached hunspell-0.4.1.tar.gz
Building wheels for collected packages: hunspellRunning setup.py bdist_wheel for hunspell ... errorComplete 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_wheelrunning buildrunning build_extbuilding 'hunspell' extensioncreating buildcreating build/temp.linux-x86_64-3.4gcc -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.ohunspell.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 hunspellRunning setup.py clean for hunspell
Failed to build hunspell
Installing collected packages: hunspellRunning setup.py install for hunspell ... errorComplete 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 installrunning buildrunning build_extbuilding 'hunspell' extensioncreating buildcreating build/temp.linux-x86_64-3.4gcc -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.ohunspell.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/

And I've heard that installing python3-dev would resolve the problem. I tried with no succes. I'm using python 3.4 under CentOS 7. Can I get some help please ? Thanks in advance.

Answer

I just went through this using python3.4 and pip3.4 on Centos7 64-bit. (NB you need both python3.4 and pip3.4)

I eventually got it working via pip3.4, but before this would work, I had to take a few extra steps. The steps I took were:

Install the python3.4 development headers:

sudo yum install python34u-devel.x86_64

Install hunspell and hunspell-devel (needed for hunspell.h and hunspell lib):

sudo yum install hunspell hunspell-devel

In /usr/lib64/, add an extra symlink for the hunspell library:

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

Finally, run the command:

sudo pip3.4 install hunspell

... and this gave me the following output:

... (compiler output deleted) ...
Successfully built hunspell
Installing collected packages: hunspell
Successfully installed hunspell-0.4.1
https://en.xdnf.cn/q/70410.html

Related Q&A

Flask-Restful taking over exception handling from Flask during non debug mode

Ive used Flasks exception handling during development (@app.errorhander(MyException)) which worked fine even for exceptions coming from Flask-Restful endpoints.However, I noticed that when switching to…

Fetching data with snowflake connector throws EmptyPyArrowIterator error

I use python snowflake connector in my python script (plotly dash app) and today the app stopped working without me changing the code. I tried a couple of things to find out what might be the issue and…

What does epochs mean in Doc2Vec and train when I have to manually run the iteration?

I am trying to understand the epochs parameter in the Doc2Vec function and epochs parameter in the train function. In the following code snippet, I manually set up a loop of 4000 iterations. Is it requ…

TensorFlow 2.0 How to get trainable variables from tf.keras.layers layers, like Conv2D or Dense

I have been trying to get the trainable variables from my layers and cant figure out a way to make it work. So here is what I have tried:I have tried accessing the kernel and bias attribute of the Dens…

Convert Excel row,column indices to alphanumeric cell reference in python/openpyxl

I want to convert the row and column indices into an Excel alphanumeric cell reference like A1. Im using python and openpyxl, and I suspect theres a utility somewhere in that package that does this, bu…

Flask-admin - how to change formatting of columns - get URLs to display

Question on flask-admin. I setup flask-admin and one of the models i created is pulling urls and url titles from a mysql database. Using flask-admin, how to i get flask-admin to render the urls instea…

Stream audio from pyaudio with Flask to HTML5

I want to stream the audio of my microphone (that is being recorded via pyaudio) via Flask to any client that connects.This is where the audio comes from:def getSound(self):# Current chunk of audio dat…

Adding into Path var while silent installation of Python - possible bug?

I need to passively install Python in my applications package installation so i use the following:python-3.5.4-amd64.exe /passive PrependPath=1according this: 3.1.4. Installing Without UI I use the Pre…

Pandas add new columns based on splitting another column

I have a pandas dataframe like the following:A B US,65,AMAZON 2016 US,65,EBAY 2016My goal is to get to look like this:A B country code com US.65.AMAZON 2016…

Proper way to insert HTML into Flask

I know how to send some plain text from Python with render_template when a URL is visited:@app.route(/success.html") ... return render_template("index.html", text="This text goes in…