python easy_install 发生Unable to find vcvarsall.bat错误的处理方法,,用python安装mms


用python安装mmseg分词包时发生了 Unable to find vcvarsall.bat 错误

Searching for mmsegReading http://pypi.python.org/simple/mmseg/Best match: mmseg 1.3.0Downloading http://pypi.python.org/packages/source/m/mmseg/mmseg-1.3.0.tar.gz#md5=ebf97c3d1cc541d0a2241f87174734d0Processing mmseg-1.3.0.tar.gzRunning mmseg-1.3.0\setup.py -q bdist_egg --dist-dir c:\users\yukaiz~1\appdata\local\temp\easy_install-7ksgyu\mmseg-1.3.0\egg-dist-tmp-c7jx3gerror: Setup script exited with error: Unable to find vcvarsall.bat

在网上查了一些资料,最后找到的正确处理方式是安装mingw,mingw是sourceforge上的一个开源项目,编译器提供了很多种的编译器。

首先需下载mingw的安装包,然后安装mingw假定mingw的安装目录为 c:\mingw 那么需要将c:\mingw\bin添加到Path系统变量中下载easy_install指向的文件,通常为tar.gz,下载后解压缩,然后运行cmd打开命令窗口,然后切换到解压缩后的setup.py所在的目录执行下面的命令
setup.py install build --compiler=mingw32

这样就可以解决easy_install “Unable to find vcvarsall.bat”错误的问题了。

评论关闭