Levenshtein
Levenshtein copied to clipboard
ModuleNotFoundError: No module named 'Levenshtein.levenshtein_cpp'
Good morning Everyone! I had this problem few minutes ago, why is there error?
PythonException:
An exception was thrown from the Python worker. Please see the stack trace below.
Traceback (most recent call last):
File "<frozen zipimport>", line 262, in load_module
File "C:\Users\Jeremy\AppData\Local\Temp\spark-bc9b7249-7b7c-45f4-bb98-bfb831cd02ea\userFiles-31251d1d-d5c1-43cc-9182-c4f18afaa741\Levenshtein.zip\Levenshtein\__init__.py", line 35, in <module>
from Levenshtein.levenshtein_cpp import (
ModuleNotFoundError: No module named 'Levenshtein.levenshtein_cpp'
How did you install the module?
I installed it inside python (and it worked), but when I wanted to insert this as .zip inside pyspark path, this returns me this thing
I assume you did not build the C extension first. In your case this can be done in place using
python setup.py build_ext --inplace
I tried to import the package inside aws and i got the same issue :(
"ModuleNotFoundError: No module named 'Levenshtein.levenshtein_cpp"
At least in case you installed using
pip install Levenshtein
This issue should not occur to the best of my knowledge.
Yeah I did it, but I had that problem.. also importing the packages inside the cloud
Did you check whether levenshtein_cpp exists in the directory. The installation should not succeed unless it created this file. So I am unsure how you ended up with this broken build.
我最近也遇到了这个问题并解决了;问题的原因如下 1、Levenshtein库需要依赖rapidfuzz库,需要将rapidfuzz一起打包; 2、注释掉 Lib\site-packages\Levenshtein_init_.py文件里的 “from Levenshtein.levenshtein_cpp import ( quickmedian, median, median_improve, setmedian, setratio, seqratio, )” 这段代码