美文网首页
Python之Unable to find vcvarsall.

Python之Unable to find vcvarsall.

作者: JetLu | 来源:发表于2016-01-12 15:35 被阅读110次

    Python 需要vcvarsall.bat只是为了获取关于vc的编译环境。

    由于提取了Visual Studio的编译器,所以我只要自己配置一个设置环境变量的bat即可。

    只需修改$python_path/lib/distutils/_msvccompiler.py里的_find_vcvarsall函数。例如:直接在函数内的首行:return 'f:/vs/x64.bat', None

    x64.bat


    @echo off
    set "Path=%~dp0\vc\bin\amd64;%~dp0\sdk\bin\x64"
    set "INCLUDE=%~dp0\vc\include;%~dp0\sdk\Include\ucrt;%~dp0\sdk\Include\shared;%~dp0\sdk\Include\um;%~dp0\sdk\Include\winrt;D:\software\python\include"
    set "LIB=%~dp0\vc\lib\amd64;%~dp0\sdk\Lib\ucrt\x64;%~dp0\sdk\Lib\um\x64;D:\software\python\libs"
    

    相关文章

      网友评论

          本文标题:Python之Unable to find vcvarsall.

          本文链接:https://www.haomeiwen.com/subject/rhhckttx.html