How to set module name with underline in python?

I am trying to install the Levenshtein module, as you can see here .

I can run the file setup.pyon python setup.py build.

Then, when I immediately go to python, executing only pythonfrom the terminal, at the same time as in the folder Levenshtein, I try to import it:

import Levenshtein,

but I get the following error:

    >>> import Levenshtein
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "Levenshtein/__init__.py", line 1, in <module>
    from Levenshtein import _levenshtein
ImportError: cannot import name _levenshtein

and when I look in the folder Levenshtein, I see two files that look like this name:

 _levenshtein.c   _levenshtein.h

How does this import make sense and how should I get a file with a name _levenshtein?

+4
source share
1 answer

, pypi , .

, , .

, 10-15% pypi , .

, pypi, , .

0

Source: https://habr.com/ru/post/1610310/


All Articles