Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'matching_blocks' is not defined #43

Open
staab opened this issue Nov 29, 2022 · 2 comments
Open

NameError: name 'matching_blocks' is not defined #43

staab opened this issue Nov 29, 2022 · 2 comments

Comments

@staab
Copy link

staab commented Nov 29, 2022

I'm getting the following error when deploying my app to heroku, but not when I develop locally:

File "/app/.heroku/python/lib/python3.9/site-packages/thefuzz/utils.py", line 38, in decorator
return func(*args, **kwargs)
File "/app/.heroku/python/lib/python3.9/site-packages/thefuzz/utils.py", line 29, in decorator
return func(*args, **kwargs)
File "/app/.heroku/python/lib/python3.9/site-packages/thefuzz/utils.py", line 47, in decorator
return func(*args, **kwargs)
File "/app/.heroku/python/lib/python3.9/site-packages/thefuzz/fuzz.py", line 47, in partial_ratio
blocks = m.get_matching_blocks()
File "/app/.heroku/python/lib/python3.9/site-packages/thefuzz/StringMatcher.py", line 58, in get_matching_blocks
self._matching_blocks = matching_blocks(self.get_opcodes(),
NameError: name 'matching_blocks' is not defined

Locally I'm using python 3.9.11, on heroku I have: python-3.9.15 as well as pip 22.3.1, setuptools 63.4.3 and wheel 0.37.1. Could this have something to do with 2to3 or modernize messing something up? I'm using thefuzz==0.19.0 and levenshtein==0.20.8. If I use fuzzywuzzy==0.18.0 and python-levenshtein==0.12.2 it works fine.

@maxbachmann
Copy link
Contributor

This is likely caused by rapidfuzz/python-Levenshtein#1, which leads to a broken upgrade between the two versions of python-Levenshtein. You should be able to resolve this by reinstalling python-Levenshtein:

pip uninstall python-Levenshtein Levenshtein
pip install Levenshtein

@maxbachmann
Copy link
Contributor

@bigtoast python-Levenshtein is not use anymore, so this is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants