[英]Installing Python Module Error
I'm a using Windows 7, Python 2.6. 我正在使用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=
我已经从http://code.google.com/p/pylevenshtein/downloads/detail?name=python-Levenshtein-0.10.1.tar.bz2&can=2&q=下载了Levenshtein扩展程序
I've set up the environment variables to C:\\PYTHON26;C:\\PYTHON26\\DLLs;C:\\PYTHON26\\LIB;C:\\PYTHON26\\LIB\\LIB-TK 我已经将环境变量设置为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: 当我运行python install setup.py实际安装它时,我得到:
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 Levenshtein
并得到ImportError: No module named Levenshtein
import StringMatcher yields: 导入StringMatcher产生:
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. 似乎您的环境没有指向c编译器的路径。 Levenshtein library is written in C and should be compiled using ac compiler.
Levenshtein库是用C编写的,应使用ac编译器进行编译。
I had the same problem, but resolved as described below. 我有同样的问题,但如下所述已解决。
Firstly, you should have Microsoft Visual Studio (for c compiler). 首先,您应该具有Microsoft Visual Studio(用于c编译器)。 I did never try other c compilers for windows.
我从未尝试过其他Windows的C编译器。
Then do the below steps: 然后执行以下步骤:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.