AttributeError: module ‘murmurhash’ has no attribute ‘hash’

(Matthew Coburn) #1

I’m unable to complete the first steps workflow. (
I just installed the new 1.7.1 version and I’m receiving the following error when I got to localhost:8080

AttributeError: module ‘murmurhash’ has no attribute ‘hash’
(Full stack trace below)

I was successfully using Prodigy 1.6 previously.

I have removed and reinstalled Spacy, Prodigy and Murmurhash.
I’m using a conda environment, and have installed Prodigy with pip.

I had upgraded Spacy to the nightly build, but have since downgraded back to version 2.0.

Seems to be some kind of murmurhash issue. Please advise.

Stack trace:
Exception when serving /get_questions
Traceback (most recent call last):
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/waitress/”, line 336, in service
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/waitress/”, line 175, in service
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/waitress/”, line 452, in execute
app_iter =, start_response)
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/hug/”, line 423, in api_auto_instantiate
return module.hug_wsgi(*args, **kwargs)
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/falcon/”, line 244, in call
responder(req, resp, **params)
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/hug/”, line 793, in call
raise exception
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/hug/”, line 766, in call
self.render_content(self.call_function(input_parameters), context, request, response, **kwargs)
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/hug/”, line 703, in call_function
return self.interface(**parameters)
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/hug/”, line 100, in call
return __hug_internal_self._function(*args, **kwargs)
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/prodigy/”, line 173, in get_questions
tasks = controller.get_questions()
File “cython_src/prodigy/core.pyx”, line 129, in prodigy.core.Controller.get_questions
File “cython_src/prodigy/components/feeds.pyx”, line 56, in prodigy.components.feeds.SharedFeed.get_questions
File “cython_src/prodigy/components/feeds.pyx”, line 61, in prodigy.components.feeds.SharedFeed.get_next_batch
File “cython_src/prodigy/components/feeds.pyx”, line 131, in prodigy.components.feeds.SessionFeed.get_session_stream
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/toolz/”, line 368, in first
return next(iter(seq))
File “cython_src/prodigy/components/sorters.pyx”, line 151, in iter
File “cython_src/prodigy/components/sorters.pyx”, line 61, in genexpr
File “cython_src/prodigy/models/ner.pyx”, line 292, in call
File “cython_src/prodigy/models/ner.pyx”, line 259, in get_tasks
File “cytoolz/itertoolz.pyx”, line 1047, in
File “cython_src/prodigy/models/ner.pyx”, line 209, in predict_spans
File “cytoolz/itertoolz.pyx”, line 1047, in
File “cython_src/prodigy/components/preprocess.pyx”, line 35, in split_sentences
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/spacy/”, line 548, in pipe
for doc, context in izip(docs, contexts):
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/spacy/”, line 572, in pipe
for doc in docs:
File “nn_parser.pyx”, line 367, in pipe
File “cytoolz/itertoolz.pyx”, line 1047, in
File “nn_parser.pyx”, line 367, in pipe
File “cytoolz/itertoolz.pyx”, line 1047, in
File “pipeline.pyx”, line 431, in pipe
File “cytoolz/itertoolz.pyx”, line 1047, in
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/spacy/”, line 746, in _pipe
for doc in docs:
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/spacy/”, line 551, in
docs = (self.make_doc(text) for text in texts)
File “/Users/mcoburn/anaconda3/envs/python3/lib/python3.6/site-packages/spacy/”, line 544, in
texts = (tc[0] for tc in text_context1)
File “cython_src/prodigy/components/preprocess.pyx”, line 34, in genexpr
File “cython_src/prodigy/components/filters.pyx”, line 35, in filter_duplicates
File “cython_src/prodigy/components/filters.pyx”, line 16, in filter_empty
File “cython_src/prodigy/components/loaders.pyx”, line 23, in _rehash_stream
File “cython_src/prodigy/util.pyx”, line 167, in prodigy.util.set_hashes
File “cython_src/prodigy/util.pyx”, line 197, in prodigy.util.get_hash
AttributeError: module ‘murmurhash’ has no attribute ‘hash’

(Ines Montani) #2

I think your instinct was right and it definitely sounds like you ended up with a messy environment somehow. Prodigy 1.7.1 dropped the mmh3 hashing library that was causing problems for some users and replaced it with a new method in our own library, murmurhash. But for some reason, it sounds like your environment still has an old murmurhash version.

It’s not the most satisfying answer, but sometimes it just helps to start off with a clean, virtual environment and then install Prodigy first. If you’re installing, uninstalling, upgrading and downgrading a lot, it’s easy to end up in a weird state. You just need one small leftover pip artifact in your site packages and the whole thing breaks.

1 Like
(Motoki Wu) #3

I think if you upgrade murmurhash the error goes away. (e.g. I switched to murmurhash==1.0.2 when I encountered this error.)

(Matthew Coburn) #4

Yeah, created a new condo env solves the problem.