简体   繁体   中英

Import Error: No module named 'utils'

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'

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM