3

Please excuse me I'm a newbie. I'm trying to use the fuzzywuzzy module from seatgeek. I am using Python 3

Initially, I was getting this error:

  from fuzzywuzzy import fuzz
ImportError: cannot import name fuzz

I changed the import statement to import fuzzywuzzy.fuzz and Now, I'm getting this error:

  File "test.py", line 4, in <module>
     import fuzzywuzzy.fuzz
  File "C:\Python33\lib\site-packages\fuzzywuzzy\fuzz.py", line 31, in <module>
     from utils import *
ImportError: No module named 'utils'
jww
  • 97,681
  • 90
  • 411
  • 885
shoi
  • 167
  • 1
  • 3
  • 7

1 Answers1

1

The fuzzywuzzy package is not Python 3 compatible, it'll only work on Python 2.

Specifically, the error is because the fuzz module uses relative imports, a technique removed from Python 3.

The repository issue tracker does have a Python 3 compatibility patch you could try out.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • Hi, Thanks for the comment. I'm still getting the same error after using the compatibility patch but thanks for letting me know its an issue with the versions. – shoi Mar 26 '13 at 18:46
  • Any idea why the same error occurs even after using the compatibility patch? – shoi Mar 27 '13 at 05:55
  • Are you certain the patch was applied properly? The `utils` import in `fuzz.py` was changed to `from .utils import *`, which means you won't see the same error at the very least. – Martijn Pieters Mar 27 '13 at 10:02