i’m trying to run the following code
from ngram import NGram
NGram.compare('foo', 'foobar')
But i’m getting the error
Traceback (most recent call last):
File "E:/pt/tandra", line 1, in <module>
from ngram import Ngram
ImportError: No module named ngram
what could be the possible reason. The ngram folder is in the same directory as the file
You don’t have module called ngram. You need to install it.
Just use
or
in terminal (for Linux, Mac OS, Cygwin in Windows) if you have python setuptools.