pytries / datrie

Fast, efficiently stored Trie for Python. Uses libdatrie.
http://pypi.python.org/pypi/datrie/
GNU Lesser General Public License v2.1
530 stars 88 forks source link

install missing pyconfig.h #13

Closed ceteri closed 10 years ago

ceteri commented 10 years ago
ubuntu@ec2-107-21-166-152:~/exelixi-master$ pip install datrie
Downloading/unpacking datrie
  Downloading datrie-0.6.1.tar.gz (154kB): 154kB downloaded
  Running setup.py egg_info for package datrie

Installing collected packages: datrie
  Running setup.py install for datrie
    building 'datrie' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ilibdatrie -I/usr/include/python2.7 -c src/datrie.c -o build/temp.linux-x86_64-2.7/src/datrie.o
    src/datrie.c:8:22: fatal error: pyconfig.h: No such file or directory
     #include "pyconfig.h"
                          ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip_build_ubuntu/datrie/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-LNhH3V-record/install-record.txt --single-version-externally-managed:
     running install
kmike commented 10 years ago

Hello,

To compile Python extensions on Ubuntu you need python-dev package - is it installed?

ceteri commented 10 years ago

got it, many thanks!

datrie is great, using it for https://github.com/ceteri/exelixi

kmike commented 10 years ago

I took a quick look at exelixi (ga.py file), and it seems that you're storing sha2 hashes in Trie; FYI: trie won't compress them much because they are almost random and share prefixes only occasionally. Also, datrie could be slow if there are many inserts because it is a Double Array Trie and some inserts require moving large blocks of memory. Standard dict could work better in this setting. If you need a Trie with fast inserts then take a look at Trie from BioPython or at https://github.com/kmike/hat-trie.

ceteri commented 10 years ago

Thank you very much, HAT-Trie looks great. Does the pip install hat-trie currently work? it's not showing up in pip search for me.

kmike commented 10 years ago

Hey @ceteri, I haven't released hat-trie to pypi yet, and README is misleading - sorry for the confusion! You can install it by running

pip install git+https://github.com/kmike/hat-trie.git#egg=hat-trie
ceteri commented 10 years ago

many thanks! i've swapped that in