本文介绍了Cython与pythonxy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Cython,但似乎找不到找到使其工作的方法。

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


  1. 我安装了pythonxy,与Cython一起提供。

  2. 我安装了MS VS 2008 Express()

  3. 然后,我从标准插件网页() 。

  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.

但是,出现此错误:

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

我的MWE在下面:

MyCyModule.pyx

MyCyModule.pyx

print 'Hello World'






TestCyModule.py


TestCyModule.py

import pyximport
pyximport.install()
import MyCyModule


推荐答案

为此,我安装了:适用于Windows Server 2008和.NET Framework 3.5的Windows SDK

此博客文章的全部功劳:,尽管我不需要复制蝙蝠文件的额外步骤(从第3点开始)

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)

从此处下载(我用d从安装说明中选择Web安装程序,然后取消选中节省大量空间的文档):

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

这篇关于Cython与pythonxy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 23:52