【问题】
折腾:
期间,安装出错:
E:\Dev_Tools\python\modules\mmseg\mmseg-1.3.0>setup.py install running install running bdist_egg running egg_info writing mmseg.egg-info\PKG-INFO writing top-level names to mmseg.egg-info\top_level.txt writing dependency_links to mmseg.egg-info\dependency_links.txt reading manifest file 'mmseg.egg-info\SOURCES.txt' writing manifest file 'mmseg.egg-info\SOURCES.txt' installing library code to build\bdist.win-amd64\egg running install_lib running build_py creating build creating build\lib.win-amd64-2.7 creating build\lib.win-amd64-2.7\mmseg copying mmseg\search.py -> build\lib.win-amd64-2.7\mmseg copying mmseg\word2.py -> build\lib.win-amd64-2.7\mmseg copying mmseg\_mmseg.py -> build\lib.win-amd64-2.7\mmseg copying mmseg\__init__.py -> build\lib.win-amd64-2.7\mmseg creating build\lib.win-amd64-2.7\mmseg\data copying mmseg\data\test.py -> build\lib.win-amd64-2.7\mmseg\data copying mmseg\data\word2_gen.py -> build\lib.win-amd64-2.7\mmseg\data copying mmseg\data\word_in_word_rm.py -> build\lib.win-amd64-2.7\mmseg\data copying mmseg\data\__init__.py -> build\lib.win-amd64-2.7\mmseg\data creating build\lib.win-amd64-2.7\mmseg\mmseg_cpp copying mmseg\mmseg_cpp\__init__.py -> build\lib.win-amd64-2.7\mmseg\mmseg_cpp copying mmseg\data\chars.dic -> build\lib.win-amd64-2.7\mmseg\data copying mmseg\data\words.dic -> build\lib.win-amd64-2.7\mmseg\data running build_ext building 'mmseg' extension error: Unable to find vcvarsall.bat
【解决过程】
1.参考了:
python—解决“Unable to find vcvarsall.bat”错误
和
error: Unable to find vcvarsall.bat
都是让安装mingw32.
此处懒得装。
2。打算去试试,看看能否利用我已有的cygwin去实现编译。
暂时放弃此复杂的方法。
3.参考上面那个:
error: Unable to find vcvarsall.bat
中别人的回答,去:
执行:
SET VS90COMNTOOLS=%VS100COMNTOOLS%
然后再去编译,貌似至少可以消除此处的问题了。
【总结】
当使用
setup.py install
去安装Python模块出现:
error: Unable to find vcvarsall.bat
的错误时,
对于像我这里:
- Python 2.7
- python2.7会去查找已安装的Visual Studio 2008,即VS90(其使用VS90COMNTOOLS这个环境变量)
- 已经安装了VS2010
- 对应的:C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools中就有了vsvars32.bat
的,不想安装mingw32的人来说,可以:
1.设置环境变量
执行:
SET VS90COMNTOOLS=%VS100COMNTOOLS%
2.再去安装:
setup.py install
就可以正常,编译,安装了。
注:
不过,我这里,好像是mmseg比较特殊,所有又出现了其他错误:
LINK : error LNK2001: 无法解析的外部符号 initmmseg
详细折腾过程参见:
【未解决】Python中安装mmseg时编译出错:LINK : error LNK2001: 无法解析的外部符号 initmmseg
转载请注明:在路上 » 【已解决】安装Python模块mmseg出错:error: Unable to find vcvarsall.bat