Cython:缺少MSVCR140.dll

时间:2018-10-23 07:38:33

标签: python python-3.x cython msvcrt visual-c++-2015

我想用Python测试Cython。当我运行python setup.py build_ext --compiler=mingw32(我在Windows上从MSYS2使用GCC)时,它告诉我cannot find -lmsvcr140(MSVCR140.dll)。从this answer开始,似乎此文件丢失,因为Visual C ++ 2015 Redistributables引入并由VCRuntime140.dll代替。我的问题是如何告诉Cython改用VCRuntime.dll?

1 个答案:

答案 0 :(得分:0)

就我而言,我将MinGW更新为MinGW-w64(已证明很关键), 并在cygwinccompiler.py中编辑代码段:

    elif int(msc_ver) >= 1900:
        # VS2015 / MSVC 14.0
        # return ['msvcr140']
        return ['vcruntime140']

然后将vcruntime140.dll放入/path/to/mingw-w64/lib,然后解决问题。