I'm a using Windows 7, Python 2.6. I've downloaded the Levenshtein extension from http://code.google.com/p/pylevenshtein/downloads/detail?name=python-Levenshtein-0.10.1.tar.bz2&can=2&q=
I've set up the environment variables to C:\\PYTHON26;C:\\PYTHON26\\DLLs;C:\\PYTHON26\\LIB;C:\\PYTHON26\\LIB\\LIB-TK
When I run the python install setup.py to actually install it, I get:
running install
running build
running build_ext
building 'Levenshtein' extension
error: None
Then I try to import Levenshtein
and I get the ImportError: No module named Levenshtein
import StringMatcher yields:
Traceback (most recent call last):
File "(stdin)", line 1, in (module)
File "stringMatcher.py", line 1, in (module)
from Levenshtein imoprt *
ImportError: No module name Levenshtein
Am I missing something stupid? This seems to happen with every extra module that I try to install.
如果安装正确,则应通过将C:\\ Python26 \\ Lib \\ site-packages添加到python路径来工作
Seems to be that your environment did not have paths to the c compiler. Levenshtein library is written in C and should be compiled using ac compiler.
I had the same problem, but resolved as described below.
Firstly, you should have Microsoft Visual Studio (for c compiler). I did never try other c compilers for windows.
Then do the below steps:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.