zoukankan      html  css  js  c++  java
  • 编译python模块要求安装vs2003问题的Hack解决办法

    今天编译一个python模块,我的python版本是2.5,vc是6.0,结果不成功提示说要用vs2003来编译,很郁闷便google之,没有找到一篇可操作的文字,更加郁闷,索性翻python编译的代码,发现在Python25\Lib\distutils\msvccompiler.py里面判断的,直接把相关代码全部注释掉,再编译结果就ok了,注释以下两处代码:

            try:
                
    if version > 7.0:
                    self.set_macro(
    "FrameworkSDKDir", net, "sdkinstallrootv1.1")
                
    else:
                    self.set_macro(
    "FrameworkSDKDir", net, "sdkinstallroot")
            
    except KeyError, exc: 
                
    raise DistutilsPlatformError, \
                      (
    """Python was built with Visual Studio 2003;
    extensions must be built with a compiler than can generate compatible binaries.
    Visual Studio 2003 was not found on this system. If you have Cygwin installed,
    you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
    """)

                if len (self.__paths== 0:
                    
    raise DistutilsPlatformError, \
                          (
    "Python was built with %s, "
                           
    "and extensions need to be built with the same "
                           
    "version of the compiler, but it isn't installed." % self.__product)


  • 相关阅读:
    最优比率环 SPFA+二分
    严格次小生成树
    SPFA判断负环BFS+DFS
    poj 1149 PIGS 网络流-最大流 建图理解
    9.20开始的停课日常
    Speed
    [BZOJ4827][Hnoi2017]礼物(FFT)
    中山纪念中学集训日志
    [POJ1151][HDU1542]Atlantis(线段树,扫描线)
    [BZOJ2002][洛谷P3203][Hnoi2010]Bounce 弹飞绵羊(LCT维护链长)
  • 原文地址:https://www.cnblogs.com/luoluo/p/996728.html
Copyright © 2011-2022 走看看