Cython with pythonxy

2019-08-08 21:40发布

问题:

I'm trying to use Cython but I can't seem to find a way of getting it to work.

  1. I installed pythonxy, which comes with Cython.
  2. I installed MS VS 2008 Express (https://go.microsoft.com/?linkid=7729279)
  3. Then I installed the Cython plugin for pythonxy from the standard plugins web page (https://code.google.com/p/pythonxy/wiki/StandardPlugins) just in case.

However, I get this error:

ImportError: Building module MyCyModule failed: ["ValueError: [u'path']\n"]

I have my MWE below:


MyCyModule.pyx

print 'Hello World'

TestCyModule.py

import pyximport
pyximport.install()
import MyCyModule

回答1:

To solve this I installed: Windows SDK for Windows Server 2008 and .NET Framework 3.5

Full credit to this blog post: http://springflex.blogspot.com/2014/02/how-to-fix-valueerror-when-trying-to.html, although I didn't need the extra steps copying the bat files (point 3 and onward)

Download from here (I used the Web Setup from the installation instructions and unchecked the documentation which saved a lot of space): http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en