aspell-python icon indicating copy to clipboard operation
aspell-python copied to clipboard

pip3 install fails: aspell.h not found

Open itsayellow opened this issue 6 years ago • 16 comments

I tried to install using pip3 on MacOS Sierra, using homebrew and python 3.6.2, and I get the following error (aspell.h not found):

>$ pip3 install aspell-python-py3
Collecting aspell-python-py3
  Downloading aspell-python-py3-1.15.tar.bz2
Building wheels for collected packages: aspell-python-py3
  Running setup.py bdist_wheel for aspell-python-py3 ... error
  Complete output from command /usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/w_/8np4m5mj3x3d9kvd9zq2s2580000gn/T/pip-build-2b4ebsy7/aspell-python-py3/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 /var/folders/w_/8np4m5mj3x3d9kvd9zq2s2580000gn/T/tmp72mb0nhcpip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_ext
  building 'aspell' extension
  creating build
  creating build/temp.macosx-10.12-x86_64-3.6
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c aspell.c -o build/temp.macosx-10.12-x86_64-3.6/aspell.o
  aspell.c:53:10: fatal error: 'aspell.h' file not found
  #include <aspell.h>
           ^
  1 error generated.
  error: command 'clang' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for aspell-python-py3
  Running setup.py clean for aspell-python-py3
Failed to build aspell-python-py3
Installing collected packages: aspell-python-py3
  Running setup.py install for aspell-python-py3 ... error
    Complete output from command /usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/w_/8np4m5mj3x3d9kvd9zq2s2580000gn/T/pip-build-2b4ebsy7/aspell-python-py3/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/w_/8np4m5mj3x3d9kvd9zq2s2580000gn/T/pip-0vdjc8ff-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'aspell' extension
    creating build
    creating build/temp.macosx-10.12-x86_64-3.6
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/local/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c aspell.c -o build/temp.macosx-10.12-x86_64-3.6/aspell.o
    aspell.c:53:10: fatal error: 'aspell.h' file not found
    #include <aspell.h>
             ^
    1 error generated.
    error: command 'clang' failed with exit status 1
    
    ----------------------------------------
Command "/usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/w_/8np4m5mj3x3d9kvd9zq2s2580000gn/T/pip-build-2b4ebsy7/aspell-python-py3/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/w_/8np4m5mj3x3d9kvd9zq2s2580000gn/T/pip-0vdjc8ff-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/w_/8np4m5mj3x3d9kvd9zq2s2580000gn/T/pip-build-2b4ebsy7/aspell-python-py3/

itsayellow avatar Jul 20 '17 22:07 itsayellow

Thank you for the report. Do you have aspell-dev installed? If you have, what's the full path to aspell.h?

WojciechMula avatar Jul 22 '17 06:07 WojciechMula

No, I don't have aspell-dev installed. I'm sorry that I wasn't aware I needed it. Is this an external dependency?

itsayellow avatar Jul 22 '17 06:07 itsayellow

Ah! I was confused which computer I was on. This computer had NO aspell installed. So when I ran: brew install aspell then pip3 install aspell-python-py3 worked fine. So in the end I just needed to brew install aspell and it worked.

itsayellow avatar Jul 22 '17 06:07 itsayellow

Good that you fixed the problem. However, it would be great if setup checked (somehow) for aspell.h presence.

WojciechMula avatar Jul 22 '17 07:07 WojciechMula

Yes it would be nice. And thanks for your help and attention. :)

itsayellow avatar Jul 22 '17 07:07 itsayellow

I have the same problem, but I did run brew install aspell and then tried pip3 install aspell-python-py3 I get the same error 'aspell.h' not found. Is there any other solution, using which I can solve this problem?

sjagadee avatar Aug 08 '17 15:08 sjagadee

Found out the solution, I installed using setup.py

module = Extension('aspell', libraries = ['aspell'], library_dirs = ['/usr/local/lib/'], include_dirs = ['/usr/local/include'], sources = ['aspell.c'] )

/usr/local/include is where my aspell.h was present, we need to find the location and add it to the setup.py to install.

sjagadee avatar Aug 08 '17 15:08 sjagadee

@sjagadee It works, but you had to manually modify the file. I'm looking for a better solution. :)

WojciechMula avatar Aug 10 '17 04:08 WojciechMula

Hi guys, I am facing the same problem but while using Windows. Can someone please help?

acerock6 avatar Oct 15 '18 13:10 acerock6

Some binary wheels on pypi would be nice.

mbarkhau avatar Apr 14 '19 09:04 mbarkhau

sudo apt-get install libaspell-dev

ltkacser avatar Jun 16 '19 14:06 ltkacser

@mbarkhau that's a long-standing issue... any help to make it possible is warmly welcomed :)

WojciechMula avatar Nov 03 '19 20:11 WojciechMula

@WojciechMula do you know if there are any licensing issues if compiled artifacts of GNU Aspell are included?

mbarkhau avatar Nov 03 '19 21:11 mbarkhau

Did some research. I'm no expert, but I guess as long as there is a link to http://aspell.net/ there should not be a problem to distribute binaries that are based on the original unchanged source.

mbarkhau avatar Nov 04 '19 13:11 mbarkhau

@mbarkhau Thanks for checking!

WojciechMula avatar Nov 06 '19 05:11 WojciechMula

sudo apt-get install libaspell-dev

Thanks alot. This worked for me!

murtuzamdahod avatar Oct 14 '20 09:10 murtuzamdahod