jamesturk / jellyfish

🪼 a python library for doing approximate and phonetic matching of strings.
https://jamesturk.github.io/jellyfish/
MIT License
2.07k stars 158 forks source link

jellyfish from PyPI won't install #22

Closed greut closed 10 years ago

greut commented 10 years ago

Good job with the release of the 0.3 version, but I have some issues installing it on Ubuntu 14.04.

$ python --version
Python 2.7.6
$ pip install jellyfish
Downloading/unpacking jellyfish
  Downloading jellyfish-0.3.0.tar.gz
  Running setup.py (path:~/.virtualenvs/pu/build/jellyfish/setup.py) egg_info for package jellyfish

    warning: no files found matching '*.c'
    warning: no files found matching '*.h'
Installing collected packages: jellyfish
  Running setup.py install for jellyfish
    building 'jellyfish.cjellyfish' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cjellyfish/jellyfishmodule.c -o build/temp.linux-x86_64-2.7/cjellyfish/jellyfishmodule.o
    cjellyfish/jellyfishmodule.c:3:23: fatal error: jellyfish.h: No such file or directory
     #include "jellyfish.h"
                           ^
    compilation terminated.
    ***************************************************************************
    WARNING: C extension could not be compiled, falling back to pure Python.
    ***************************************************************************

    warning: no files found matching '*.c'
    warning: no files found matching '*.h'
    ***************************************************************************
    WARNING: C extension could not be compiled, falling back to pure Python.
    ***************************************************************************
Successfully installed jellyfish
Cleaning up...
$ python -c "import jellyfish"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named jellyfish

The dev version works just fine tough.

$ pip install -e git://github.com/sunlightlabs/jellyfish.git#egg=jellyfish-dev
    Creating ~/.virtualenvs/pu/lib/python2.7/site-packages/jellyfish.egg-link (link to .)
    Adding jellyfish 0.3.0 to easy-install.pth file

    Installed ~/.virtualenvs/pu/src/jellyfish
Successfully installed jellyfish
$ python -c "import jellyfish"
$ # profit!

No .h were found in the .tar.gz from PyPI

$ wget https://pypi.python.org/packages/source/j/jellyfish/jellyfish-0.3.0.tar.gz
$ tar -xvzf jellyfish-0.3.0.tar.gz 
jellyfish-0.3.0/
jellyfish-0.3.0/cjellyfish/
jellyfish-0.3.0/cjellyfish/jellyfishmodule.c
jellyfish-0.3.0/cjellyfish/levenshtein.c
jellyfish-0.3.0/cjellyfish/hamming.c
jellyfish-0.3.0/cjellyfish/soundex.c
jellyfish-0.3.0/cjellyfish/jaro.c
jellyfish-0.3.0/cjellyfish/metaphone.c
jellyfish-0.3.0/cjellyfish/porter.c
jellyfish-0.3.0/cjellyfish/damerau_levenshtein.c
jellyfish-0.3.0/cjellyfish/nysiis.c
jellyfish-0.3.0/cjellyfish/mra.c
jellyfish-0.3.0/jellyfish/
jellyfish-0.3.0/jellyfish/test.py
jellyfish-0.3.0/jellyfish/porter.py
jellyfish-0.3.0/jellyfish/_jellyfish.py
jellyfish-0.3.0/jellyfish/__init__.py
jellyfish-0.3.0/jellyfish/compat.py
jellyfish-0.3.0/README.rst
jellyfish-0.3.0/setup.py
jellyfish-0.3.0/setup.cfg
jellyfish-0.3.0/PKG-INFO
jellyfish-0.3.0/jellyfish.egg-info/
jellyfish-0.3.0/jellyfish.egg-info/dependency_links.txt
jellyfish-0.3.0/jellyfish.egg-info/top_level.txt
jellyfish-0.3.0/jellyfish.egg-info/PKG-INFO
jellyfish-0.3.0/jellyfish.egg-info/SOURCES.txt
jellyfish-0.3.0/MANIFEST.in
jellyfish-0.3.0/LICENSE
jamesturk commented 10 years ago

2 issues here- the python fallback wasn't being installed correctly and the header wasn't included in the tarball. these both should be fixed in 0.3.1, can you give that a try to confirm?

greut commented 10 years ago

LGTM :+1:, thanks!

$ pip install jellyfish
Downloading/unpacking jellyfish
  Downloading jellyfish-0.3.1.tar.gz
  Running setup.py (path:~/.virtualenvs/pu/build/jellyfish/setup.py) egg_info for package jellyfish

Installing collected packages: jellyfish
  Running setup.py install for jellyfish
    building 'jellyfish.cjellyfish' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cjellyfish/jellyfishmodule.c -o build/temp.linux-x86_64-2.7/cjellyfish/jellyfishmodule.o
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cjellyfish/jaro.c -o build/temp.linux-x86_64-2.7/cjellyfish/jaro.o
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cjellyfish/hamming.c -o build/temp.linux-x86_64-2.7/cjellyfish/hamming.o
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cjellyfish/levenshtein.c -o build/temp.linux-x86_64-2.7/cjellyfish/levenshtein.o
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cjellyfish/damerau_levenshtein.c -o build/temp.linux-x86_64-2.7/cjellyfish/damerau_levenshtein.o
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cjellyfish/mra.c -o build/temp.linux-x86_64-2.7/cjellyfish/mra.o
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cjellyfish/soundex.c -o build/temp.linux-x86_64-2.7/cjellyfish/soundex.o
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cjellyfish/metaphone.c -o build/temp.linux-x86_64-2.7/cjellyfish/metaphone.o
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cjellyfish/nysiis.c -o build/temp.linux-x86_64-2.7/cjellyfish/nysiis.o
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c cjellyfish/porter.c -o build/temp.linux-x86_64-2.7/cjellyfish/porter.o
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/cjellyfish/jellyfishmodule.o build/temp.linux-x86_64-2.7/cjellyfish/jaro.o build/temp.linux-x86_64-2.7/cjellyfish/hamming.o build/temp.linux-x86_64-2.7/cjellyfish/levenshtein.o build/temp.linux-x86_64-2.7/cjellyfish/damerau_levenshtein.o build/temp.linux-x86_64-2.7/cjellyfish/mra.o build/temp.linux-x86_64-2.7/cjellyfish/soundex.o build/temp.linux-x86_64-2.7/cjellyfish/metaphone.o build/temp.linux-x86_64-2.7/cjellyfish/nysiis.o build/temp.linux-x86_64-2.7/cjellyfish/porter.o -o build/lib.linux-x86_64-2.7/jellyfish/cjellyfish.so

Successfully installed jellyfish
Cleaning up...
lvpasquier commented 8 years ago

Hi,

I'm having a quite similar issue about cjellyfish.

When I pip install it it goes super clean. Though, when I try to install it in a virgin virtualenv it will only install the pure python version of function :

Finished processing dependencies for jellyfish==0.5.6
***************************************************************************
WARNING: C extension could not be compiled, falling back to pure Python.
***************************************************************************

any clue ? how should I compile C version of jellyfish distances in my virtualenv ?

By the way, very convenient package :D !

Dithyrambe

jamesturk commented 8 years ago

Can you show more of the error? There's likely compiler errors near that most likely

lvpasquier commented 8 years ago

False alarm,

I post my comment too fast ... Everything's all right. I just went messy when using pip.

Everything's fine, thanks for your reply.

Dithyrambe