ValueError: Unknown MS Compiler version 1900

后端 未结 6 1091
日久生厌
日久生厌 2020-11-28 07:08

I am trying to run some code with Python 3.5 on Windows 10 with the use of cygwin (mingw). To be precise I am using the PyDSTool module, where I call the dopri integrator. T

相关标签:
6条回答
  • 2020-11-28 07:34

    If anyone still has this problem,i just ran into it while installing yowsup and python-axolotl, this is what i did to solve it:

    1- Apply the patch from Tharen into the python cygwinccompiler.py file (located in your python installation folder) https://bugs.python.org/file40608/patch.diff

    2-With mingw, install pexports, open a terminal in administrator mode and type:

    mingw-get install pexports
    

    2-Go to the python install folder, in my case it was C:\Program Files (x86)\Python36-32

    still in the same terminal we used to install pexports, after navigating to the python install folder run the following:

    pexports vcruntime140.dll >libs\vcruntime140.def
    dlltool -dllname vcruntime140.dll --def libs\vcruntime140.def --output-lib libs\libvcruntime140.a
    

    Then go back to the folder where you were installing the library, or whatever you were doing before, it should work now.

    btw, dont forget to add

    [build]
    compiler = mingw32 
    

    in the distutils file.

    Source: this own post and https://bugs.python.org/issue25251

    0 讨论(0)
  • 2020-11-28 07:34

    I was running on the same problem and figured out that the issue was with the mingw compiler. I tried the patches suggested by @tharen but it didn't work for me.

    It seems that cygwin's favourite compiler for windows is the visual c++ so I downloaded just the visual c++ build tools from http://landinghub.visualstudio.com/visual-cpp-build-tools and then it worked fine.

    Note that you will need to uninstall mingw and all references to it that you included in your project. In particular I had to delete a distutils.cfg file that I had created which had the following code pointing to mingw

    [build]
    compiler = mingw32
    
    0 讨论(0)
  • 2020-11-28 07:39

    Details in link helped me resolve this like a charm.

    Just commented get_msvcr() in cygwinccompiler.py.

    (remember to comment the else also)

    0 讨论(0)
  • 2020-11-28 07:41

    Distutils and Numpy/Distutils currently do not have support for Visual Studio 2015, Visual C++ 14. Following tips drawn from the Python bug report, I was able to patch the necessary files and successfully build extension using a new install of Python 3.5 from Anaconda and Mingw64 with GCC 5.2.0 running within MSYS2 on Windows 7. I do not have Visual Studio installed. The solution was to patch one distutils file and two numpy/distutils files (if this applies). These patches have been submitted for inclusion in future revisions.

    You can apply the patches yourself for a quick fix:

    • distutils patch
    • numpy/distutils patch

    UPDATE

    Please note that while the patches above worked for me it was not accepted for inclusion in upstream. The changes that came with VS 2015 are more complex than I appreciated.

    0 讨论(0)
  • 2020-11-28 07:47

    I made the following changes and it worked for me with the following configurations.

    • OS : Win 7 Prof. SP1 64 bit
    • CPython 3.6 , 64 Bit
    • Mingw 64 (x86_64-7.1.0-posix-seh-rt_v5-rev0)
    • Cython 0.25.2

    I did the following

    1. Add mingw in the PATH variable (C:\mingw-w64\x86_64-7.1.0-posix-seh-rt_v5-rev0\mingw64\bin for me)
    2. Test by opening command line and command gcc works ( I have no other compilers)
    3. Create distutils.cfg in C:\Python36\Lib\distutils
    4. Add lines in that file:

      [build]
      compiler = mingw32
      
    5. Manually applying this patch

    6. Manually downloading the file vcruntime140.dll and putting it in C:\Python36\libs
    0 讨论(0)
  • 2020-11-28 07:51

    I just made he following changes and it worked like a charm!

    Edit file distutils.cfg present in locations:

    1. C:\Users\\AppData\Local\Continuum\Anaconda3\Lib\distutils\
    2. C:\Users\\AppData\Local\Continuum\Anaconda3\pkgs\libpython-2.0-py36_0\Lib\distutils

    Modify content of distutils.cfg to :

    [build]
    compiler=g++
    
    [build_ext]           
    compiler=g++
    

    P.S. Probably changing only in 2nd location should also do.

    P.P.S Make sure gcc is installed and is in PATH. For me , TDM-GCC-64 was installed

    0 讨论(0)
提交回复
热议问题