In [1]:
%load_ext Cython

In [2]:
%%cython

cdef int a = 0
for i in range(10):
    a += i
print a


---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
C:\Anaconda3\lib\distutils\ccompiler.py in new_compiler(plat, compiler, verbose, dry_run, force)
   1006 
-> 1007         (module_name, class_name, long_description) = compiler_class[compiler]
   1008     except KeyError:

KeyError: 'mingw64'

During handling of the above exception, another exception occurred:

DistutilsPlatformError                    Traceback (most recent call last)
<ipython-input-2-6d4111f59e8d> in <module>()
----> 1 get_ipython().run_cell_magic('cython', '', '\ncdef int a = 0\nfor i in range(10):\n    a += i\nprint a')

C:\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
   2118             magic_arg_s = self.var_expand(line, stack_depth)
   2119             with self.builtin_trap:
-> 2120                 result = fn(magic_arg_s, cell)
   2121             return result
   2122 

<decorator-gen-127> in cython(self, line, cell)

C:\Anaconda3\lib\site-packages\IPython\core\magic.py in <lambda>(f, *a, **k)
    191     # but it's overkill for just that one bit of state.
    192     def magic_deco(arg):
--> 193         call = lambda f, *a, **k: f(*a, **k)
    194 
    195         if callable(arg):

C:\Anaconda3\lib\site-packages\Cython\Build\IpythonMagic.py in cython(self, line, cell)
    276             build_extension.build_temp = os.path.dirname(pyx_file)
    277             build_extension.build_lib  = lib_dir
--> 278             build_extension.run()
    279             self._code_cache[key] = module_name
    280 

C:\Anaconda3\lib\distutils\command\build_ext.py in run(self)
    305                                      verbose=self.verbose,
    306                                      dry_run=self.dry_run,
--> 307                                      force=self.force)
    308         customize_compiler(self.compiler)
    309         # If we are cross-compiling, init the compiler now (if we are not

C:\Anaconda3\lib\distutils\ccompiler.py in new_compiler(plat, compiler, verbose, dry_run, force)
   1010         if compiler is not None:
   1011             msg = msg + " with '%s' compiler" % compiler
-> 1012         raise DistutilsPlatformError(msg)
   1013 
   1014     try:

DistutilsPlatformError: don't know how to compile C/C++ code on platform 'nt' with 'mingw64' compiler

In [ ]: