1

I downloaded Cython and followed the instructions found here: http://cython.readthedocs.io/en/latest/src/tutorial/appendix.html

I have the MinGW compiler already

I am using python3 not python2, but according to this video (https://www.youtube.com/watch?v=mXuEoqK4bEc&vl=en) it looks like one can just use python 3. Anyways, when I try to do the command python setup.py build_ext --inplace (unlike in the video, one must write python instead of python3, otherwise it won't even start to run), I get the error message below:

Traceback (most recent call last):
File "setup.py", line 4, in <module>
   setup(ext_modules = cythonize('cython_example.pyx'))
File "C:\Program Files\Python37\lib\distutils\core.py", line 148, in setup
   dist.run_commands()
File "C:\Program Files\Python37\lib\distutils\dist.py", line 966, in run_commands
   self.run_command(cmd)
File "C:\Program Files\Python37\lib\distutils\dist.py", line 985, in run_command 
    cmd_obj.run()
File "C:\Program Files\Python37\lib\distutils\command\build_ext.py", line 308, in run force=self.force)
File "C:\Program Files\Python37\lib\distutils\ccompiler.py", line 1031, in new_compiler
    return klass(None, dry_run, force)
File "C:\Program Files\Python37\lib\distutils\cygwinccompiler.py", line 282, in __init__
    CygwinCCompiler.__init__ (self, verbose, dry_run, force)
File "C:\Program Files\Python37\lib\distutils\cygwinccompiler.py", line 157, in __init__
    self.dll_libraries = get_msvcr()
File "C:\Program Files\Python37\lib\distutils\cygwinccompiler.py", line 86, in get_msvcr
    raise ValueError("Unknown MS Compiler version %s " % msc_ver)
ValueError: Unknown MS Compiler version 1914
  • 2
    The error message says it all. In order to compile C code generated by Cython one needs to install the C compiler prior to using Cython. You might also need to specify which compiler you are using in setup file using script_args and --compiler flag – Mick_ Aug 10 '18 at 22:25
  • @Mick_ i already have the MinGW compiler, is that enough? How does one specify implement the script_args and -compiler flag you were talking about though? Could you show me some cod e –  Aug 10 '18 at 22:36
  • https://stackoverflow.com/a/43971456/9473285 – Mick_ Aug 11 '18 at 00:05

0 Answers0