seatgeek / fuzzywuzzy

Fuzzy String Matching in Python
http://chairnerd.seatgeek.com/fuzzywuzzy-fuzzy-string-matching-in-python/
GNU General Public License v2.0
9.2k stars 878 forks source link

Missing functions after import. #309

Closed poedator closed 3 years ago

poedator commented 3 years ago

Somehow after import I am unable to use key fuzzywuzzy functions/modules, like fuzzy.

ImportError                               Traceback (most recent call last)
<ipython-input-33-0832874e3cbf> in <module>
----> 1 from fuzzywuzzy import fuzzy

ImportError: cannot import name 'fuzzy' from 'fuzzywuzzy' (/opt/conda/lib/python3.7/site-packages/fuzzywuzzy/__init__.py)

dir() shows that only double underline functions are present:

dir(fuzzywuzzy):
['__builtins__',
 '__cached__',
 '__doc__',
 '__file__',
 '__loader__',
 '__name__',
 '__package__',
 '__path__',
 '__spec__',
 '__version__']

The problem tested and appears with python 3.7 and 3.8, in Ubuntu and Win-10 environment, both Conda and pip, versions tested: 0.18, 0.17, 0.16.

maxbachmann commented 3 years ago

The module is not called fuzzy but fuzz:

 from fuzzywuzzy import fuzz
poedator commented 3 years ago
 from fuzzywuzzy import fuzz

You are correct - it was just a type. Thanks!