Spacy: pip3 install fails because of murmurhash

Created on 6 Oct 2017  Â·  14Comments  Â·  Source: explosion/spaCy

Running

pip3 install spacy

Got this error regarding murmurhash

Running setup.py install for murmurhash ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-08p_xmrv/murmurhash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-1zndpl3r-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/murmurhash
copying murmurhash/about.py -> build/lib.linux-x86_64-3.6/murmurhash
copying murmurhash/__init__.py -> build/lib.linux-x86_64-3.6/murmurhash
creating build/lib.linux-x86_64-3.6/murmurhash/tests
copying murmurhash/tests/test_import.py -> build/lib.linux-x86_64-3.6/murmurhash/tests
copying murmurhash/tests/__init__.py -> build/lib.linux-x86_64-3.6/murmurhash/tests
copying murmurhash/mrmr.pyx -> build/lib.linux-x86_64-3.6/murmurhash
copying murmurhash/mrmr.pxd -> build/lib.linux-x86_64-3.6/murmurhash
copying murmurhash/__init__.pxd -> build/lib.linux-x86_64-3.6/murmurhash
creating build/lib.linux-x86_64-3.6/murmurhash/include
creating build/lib.linux-x86_64-3.6/murmurhash/include/murmurhash
copying murmurhash/include/murmurhash/MurmurHash2.h -> build/lib.linux-x86_64-3.6/murmurhash/include/murmurhash
copying murmurhash/include/murmurhash/MurmurHash3.h -> build/lib.linux-x86_64-3.6/murmurhash/include/murmurhash
running build_ext
building 'murmurhash.mrmr' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/murmurhash
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -I/tmp/pip-build-08p_xmrv/murmurhash/murmurhash/include -I/usr/include/python3.6m -c murmurhash/mrmr.cpp -o build/temp.linux-x86_64-3.6/murmurhash/mrmr.o -O3 -Wno-strict-prototypes -Wno-unused-function
cc1plus: warning: command line option ‘-Wno-strict-prototypes’ is valid for C/ObjC but not for C++
murmurhash/mrmr.cpp:4:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-08p_xmrv/murmurhash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-1zndpl3r-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-08p_xmrv/murmurhash/

Your Environment

ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial

install

Most helpful comment

@urigoren Just ran into this while provisioning a new server.

I installed python3.6, so I needed the python3.6-dev package to get the headers.

All 14 comments

Hmm, it can't find the Python headers. Is your python installed in a strange place?

Looks pretty standard:

ubuntu ~> which pip3
/usr/local/bin/pip3
ubuntu ~> which python
/usr/bin/python
ubuntu ~> which python3
/usr/bin/python3
ubuntu ~> which pip
/usr/local/bin/pip

Hi Matthew,
I get the same error when installing on ubuntu 16.04

@urigoren @salexln Please try sudo apt-get install python3-dev

Googling around, it seems likely you're missing the Python3 development headers.

Hi @honnibal , the python dev is already installed in both versions.

ubuntu ~> sudo apt-get install python3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-dev is already the newest version (3.5.1-3).
0 upgraded, 0 newly installed, 0 to remove and 87 not upgraded.
ubuntu ~> sudo apt-get install python-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-dev is already the newest version (2.7.11-1).
0 upgraded, 0 newly installed, 0 to remove and 87 not upgraded.

And yet the error persists,
Do you know what else could cause the issue ?

same for me

@honnibal , any updates on the murmurhash issue on ubuntu ?

@urigoren Just ran into this while provisioning a new server.

I installed python3.6, so I needed the python3.6-dev package to get the headers.

Thank you @honnibal , that solved my issue

I was having the same problem in my centos 7 with python2.7. Could able to resolve after installing

$ sudo yum install yum-utils
$ sudo yum-builddep python

Thank you coolrb, this helped for redhat (on aws ec2) as well while install spacy

$ sudo yum install yum-utils
$ sudo yum-builddep python

Is there a Windows 10 solution for this? I am trying to install anchors_exp which also uses spacy

For future reference, this installs correctly via conda install spacy, but not via pip install spacy

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings