0

I am trying to calculate levenshtein distance between 2 strings. Tried to install 2 packages (python-levenshtein) and pylev

Used ananconda (on Win 64 machine) for the install

conda install -c https://conda.anaconda.org/trent pylevenshtein

It looks like the package got installed

Fetching package metadata: ......
Solving package specifications: ..............
Package plan for installation in environment C:\Anaconda2:

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
pylevenshtein-0.10.1       |           py27_0          34 KB
setuptools-20.1.1          |           py27_0         674 KB
------------------------------------------------------------
                                       Total:         707 KB

The following NEW packages will be INSTALLED:

pylevenshtein: 0.10.1-py27_0

The following packages will be UPDATED:

setuptools:    19.6.2-py27_0 --> 20.1.1-py27_0

Proceed ([y]/n)? y

Fetching packages ...
pylevenshtein- 100% |###############################| Time: 0:00:0042.36    kB/s
setuptools-20. 100% |###############################| Time: 0:00:02 320.43 kB/s
 Extracting packages ...
[      COMPLETE      ]|##################################################| 100%
Unlinking packages ...
[      COMPLETE      ]|##################################################| 100%
Linking packages ...
[      COMPLETE      ]|##################################################| 100%

However , when I try to import the package it says no module name pylev . Same thing happens with Python-levenshtein . Command used are (tried variants of his but doesn't seem to work)

import pylev
import Levenshtein

Unable to figure out what the problem is

sourav
  • 179
  • 1
  • 1
  • 14
  • Are you sure your python path is properly configured as an environment variable on your system and isn't in conflict with another installation of python? – Dan Feb 23 '16 at 04:48
  • I had installed "Seaborn" package the same way and it worked. – sourav Feb 23 '16 at 04:53
  • Dont know if this helps but I can see the packages in this folder - C:\Anaconda2\pkgs . – sourav Feb 23 '16 at 05:11

1 Answers1

0

Some modules (this is a C extension) must be compiled for the architecture you are using. See explained for your case here.

But you can always use compiled versions if they are available (as is the case for pylevenshtein) from Christoph Gohlke's website

roadrunner66
  • 7,772
  • 4
  • 32
  • 38