- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正尝试按照 Cython 中的教程进行操作:http://docs.cython.org/docs/tutorial.html#the-basics-of-cython我遇到了问题。
文件非常简单。我有一个 helloworld.pyx:
print "Hello World"
和一个setup.py:
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [Extension("helloworld", ["helloworld.pyx"])]
)
然后我用标准命令编译它:
python setup.py build_ext --inplace
我收到以下错误:
running build
running build_ext
building 'helloworld' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c helloworld.c -o build/temp.linux-x86_64-2.6/helloworld.o
helloworld.c:4:20: error: Python.h: No such file or directory
helloworld.c:5:26: error: structmember.h: No such file or directory
helloworld.c:34: error: expected specifier-qualifier-list before ‘PyObject’
helloworld.c:121: error: expected specifier-qualifier-list before ‘PyObject’
helloworld.c:139: error: expected ‘)’ before ‘*’ token
helloworld.c:140: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__pyx_PyInt_AsLongLong’
helloworld.c:141: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__pyx_PyInt_AsUnsignedLongLong’
helloworld.c:142: error: expected ‘)’ before ‘*’ token
helloworld.c:147: error: expected ‘)’ before ‘*’ token
helloworld.c:148: error: expected ‘)’ before ‘*’ token
helloworld.c:149: error: expected ‘)’ before ‘*’ token
helloworld.c:150: error: expected ‘)’ before ‘*’ token
helloworld.c:151: error: expected ‘)’ before ‘*’ token
helloworld.c:152: error: expected ‘)’ before ‘*’ token
helloworld.c:153: error: expected ‘)’ before ‘*’ token
helloworld.c:154: error: expected ‘)’ before ‘*’ token
helloworld.c:155: error: expected ‘)’ before ‘*’ token
helloworld.c:156: error: expected ‘)’ before ‘*’ token
helloworld.c:157: error: expected ‘)’ before ‘*’ token
helloworld.c:172: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
helloworld.c:173: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
helloworld.c:174: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
helloworld.c:181: error: expected ‘)’ before ‘*’ token
helloworld.c:198: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
helloworld.c:200: error: array type has incomplete element type
helloworld.c:221: error: ‘__pyx_kp_1’ undeclared here (not in a function)
helloworld.c:221: warning: excess elements in struct initializer
helloworld.c:221: warning: (near initialization for ‘__pyx_string_tab[0]’)
helloworld.c:221: warning: excess elements in struct initializer
helloworld.c:221: warning: (near initialization for ‘__pyx_string_tab[0]’)
helloworld.c:221: warning: excess elements in struct initializer
helloworld.c:221: warning: (near initialization for ‘__pyx_string_tab[0]’)
helloworld.c:221: warning: excess elements in struct initializer
helloworld.c:221: warning: (near initialization for ‘__pyx_string_tab[0]’)
helloworld.c:221: warning: excess elements in struct initializer
helloworld.c:221: warning: (near initialization for ‘__pyx_string_tab[0]’)
helloworld.c:221: warning: excess elements in struct initializer
helloworld.c:221: warning: (near initialization for ‘__pyx_string_tab[0]’)
helloworld.c:222: warning: excess elements in struct initializer
helloworld.c:222: warning: (near initialization for ‘__pyx_string_tab[1]’)
helloworld.c:222: warning: excess elements in struct initializer
helloworld.c:222: warning: (near initialization for ‘__pyx_string_tab[1]’)
helloworld.c:222: warning: excess elements in struct initializer
helloworld.c:222: warning: (near initialization for ‘__pyx_string_tab[1]’)
helloworld.c:222: warning: excess elements in struct initializer
helloworld.c:222: warning: (near initialization for ‘__pyx_string_tab[1]’)
helloworld.c:222: warning: excess elements in struct initializer
helloworld.c:222: warning: (near initialization for ‘__pyx_string_tab[1]’)
helloworld.c:222: warning: excess elements in struct initializer
helloworld.c:222: warning: (near initialization for ‘__pyx_string_tab[1]’)
helloworld.c:237: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘inithelloworld’
helloworld.c:238: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘inithelloworld’
helloworld.c:305: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
helloworld.c:313: error: expected ‘)’ before ‘*’ token
helloworld.c:379:21: error: compile.h: No such file or directory
helloworld.c:380:25: error: frameobject.h: No such file or directory
helloworld.c:381:23: error: traceback.h: No such file or directory
helloworld.c: In function ‘__Pyx_AddTraceback’:
helloworld.c:384: error: ‘PyObject’ undeclared (first use in this function)
helloworld.c:384: error: (Each undeclared identifier is reported only once
helloworld.c:384: error: for each function it appears in.)
helloworld.c:384: error: ‘py_srcfile’ undeclared (first use in this function)
helloworld.c:385: error: ‘py_funcname’ undeclared (first use in this function)
helloworld.c:386: error: ‘py_globals’ undeclared (first use in this function)
helloworld.c:387: error: ‘empty_string’ undeclared (first use in this function)
helloworld.c:388: error: ‘PyCodeObject’ undeclared (first use in this function)
helloworld.c:388: error: ‘py_code’ undeclared (first use in this function)
helloworld.c:389: error: ‘PyFrameObject’ undeclared (first use in this function)
helloworld.c:389: error: ‘py_frame’ undeclared (first use in this function)
helloworld.c:392: warning: implicit declaration of function ‘PyString_FromString’
helloworld.c:399: warning: implicit declaration of function ‘PyString_FromFormat’
helloworld.c:412: warning: implicit declaration of function ‘PyModule_GetDict’
helloworld.c:412: error: ‘__pyx_m’ undeclared (first use in this function)
helloworld.c:415: warning: implicit declaration of function ‘PyString_FromStringAndSize’
helloworld.c:420: warning: implicit declaration of function ‘PyCode_New’
helloworld.c:429: error: ‘__pyx_empty_tuple’ undeclared (first use in this function)
helloworld.c:440: warning: implicit declaration of function ‘PyFrame_New’
helloworld.c:441: warning: implicit declaration of function ‘PyThreadState_GET’
helloworld.c:448: warning: implicit declaration of function ‘PyTraceBack_Here’
helloworld.c:450: warning: implicit declaration of function ‘Py_XDECREF’
helloworld.c: In function ‘__Pyx_InitStrings’:
helloworld.c:458: error: ‘__Pyx_StringTabEntry’ has no member named ‘p’
helloworld.c:460: error: ‘__Pyx_StringTabEntry’ has no member named ‘is_unicode’
helloworld.c:460: error: ‘__Pyx_StringTabEntry’ has no member named ‘is_identifier’
helloworld.c:461: error: ‘__Pyx_StringTabEntry’ has no member named ‘p’
helloworld.c:461: warning: implicit declaration of function ‘PyUnicode_DecodeUTF8’
helloworld.c:461: error: ‘__Pyx_StringTabEntry’ has no member named ‘s’
helloworld.c:461: error: ‘__Pyx_StringTabEntry’ has no member named ‘n’
helloworld.c:461: error: ‘NULL’ undeclared (first use in this function)
helloworld.c:462: error: ‘__Pyx_StringTabEntry’ has no member named ‘intern’
helloworld.c:463: error: ‘__Pyx_StringTabEntry’ has no member named ‘p’
helloworld.c:463: warning: implicit declaration of function ‘PyString_InternFromString’
helloworld.c:463: error: ‘__Pyx_StringTabEntry’ has no member named ‘s’
helloworld.c:465: error: ‘__Pyx_StringTabEntry’ has no member named ‘p’
helloworld.c:465: error: ‘__Pyx_StringTabEntry’ has no member named ‘s’
helloworld.c:465: error: ‘__Pyx_StringTabEntry’ has no member named ‘n’
helloworld.c:476: error: ‘__Pyx_StringTabEntry’ has no member named ‘p’
helloworld.c: At top level:
helloworld.c:485: error: expected ‘)’ before ‘*’ token
helloworld.c:494: error: expected ‘)’ before ‘*’ token
helloworld.c:500: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__pyx_PyInt_AsLongLong’
helloworld.c:516: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__pyx_PyInt_AsUnsignedLongLong’
helloworld.c:538: error: expected ‘)’ before ‘*’ token
helloworld.c:553: error: expected ‘)’ before ‘*’ token
helloworld.c:568: error: expected ‘)’ before ‘*’ token
helloworld.c:583: error: expected ‘)’ before ‘*’ token
helloworld.c:598: error: expected ‘)’ before ‘*’ token
helloworld.c:613: error: expected ‘)’ before ‘*’ token
helloworld.c:628: error: expected ‘)’ before ‘*’ token
helloworld.c:643: error: expected ‘)’ before ‘*’ token
helloworld.c:658: error: expected ‘)’ before ‘*’ token
helloworld.c:673: error: expected ‘)’ before ‘*’ token
helloworld.c:688: error: expected ‘)’ before ‘*’ token
error: command 'gcc' failed with exit status 1
我从 Ubuntu 9.04 存储库安装了 python 和 cython。我不明白为什么编译器找不到 Python.h。
我试过:
cython helloworld.pyx
然后用gcc手动编译结果:
gcc -shared -pthread -fPIC -fwrapv -O2 -Wall -fno-strict-aliasing -I/usr/include/python2.5 -o helloworld.so helloworld.c
并得到完全相同的错误消息。
有什么线索吗?
最佳答案
看起来您缺少一些像 python_dev
之类的软件包——Debian 和衍生产品(包括 Ubuntu)长期以来倾向于将可能被“开发人员”使用的所有东西与包裹中“每个人”的部分……我可以辩论的一种哲学立场(并且已经在许多论坛中辩论过,但没有取得太大的实际成功),但可悲的是,不能只是忽略:-(
关于c++ - 来自 cython wiki 的 Hello World 无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1191600/
我在父项目 A 的子项目 B 中有几个 wiki 页面。现在我想将它们从 B 的 wiki 移动到 A 的 wiki。如何在不复制和粘贴所有页面的情况下执行此操作? Redmine论坛的人建议直接编辑
如果两个用户编辑同一个 wiki 主题,wiki(或类似的协作编辑软件)中使用了什么方法将第二个用户的编辑与第一个用户的编辑合并? 我想要一个解决方案: 不需要锁定 不会丢失对页面的任何添加。 它可能
关闭。这个问题需要更多 focused .它目前不接受答案。 想改进这个问题?更新问题,使其仅关注一个问题 editing this post . 8年前关闭。 Improve this questi
我们正在向许多地方的许多用户(8 个国家/地区的 200 多个用户)部署新的软件系统。过去,我们为用户编写了手册,然后经常更新。这很好用,因为所有用户都有相同的手册,它涵盖了主要内容,但也有问题,比如
这张 table 是什么样子的——只有一张吗?你如何恢复到旧版本?类似于堆栈溢出的工作方式。 最佳答案 解决此问题的最佳方法是查看其他软件,例如 MediaWiki,并了解它们如何构建数据库。然后,您
我正在尝试使用 Redmine wiki,但我很难弄清楚如何使文本看起来不那么大。这是我正在做的标记示例。关于如何使文本看起来不那么大的任何建议。 h1. Best Practices
在Redmine Wiki中,有什么方法可以在标题中使用项目符号点编号,例如 # h1. Heading 1 ## h2. Sub Heading 1 # h1. Heading 2 输出如下
关闭。这个问题是opinion-based .它目前不接受答案。 想改善这个问题吗?更新问题,以便可以通过 editing this post 用事实和引文回答问题. 4年前关闭。 Improve t
目前我们团队正在使用MoinMoin作为 IT wiki,它非常好。 我们希望促进最终用户使用 wiki,因为他们中的一些人对此感兴趣。例如,我们将在 wiki 上共享和编辑应用程序的要求。 我认为
我的公司将使用Confluence在我们的IT系统上存储和共享我们的知识库,并且可以用于涵盖从硬件管理到程序员所面临的问题的主题。 我对建立全局空间的最佳做法感到好奇。为整个IT部门拥有一个大型的,万
对于我正在开发的应用程序 (*),我需要混合使用动态生成的页面和静态页面。使用 wiki 会很酷,一旦动态页面被第一次访问,它就会变成静态页面,用户可以像任何其他静态 wiki 页面一样对其进行注释。
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 11 年前。 Improve thi
您在公司中使用 wiki 吗?谁使用它以及为什么使用它。您是否在项目/团队/部门之间共享信息? 最佳答案 我们用我们的来存储 编码风格文档 网络服务器和网站的设置和部署程序 网络图(Dev、Stagi
我在 Trac wiki 中创建了一些文档。我将这些页面设置为都以相同的模式开始(例如“MyDoc ...”)。我想从 Trac 中检索以该模式开头的页面的所有 wiki 页面链接。 有办法吗? 最佳
我和我的 friend 正在考虑创建我们自己的 wiki。鉴于它们最近变得如此普遍,我们听说这并不难。我们希望网站尽可能简单——我们在网页设计方面有一些经验,但在系统管理方面没有很多经验。 futur
我的服务器上运行着一个 Gitlab CE 11.7 docker。当我从 gitlab.com 导入一个项目时,它的 wiki 丢失了。我使用内置界面导入项目: 新建项目 > 导入项目 [tab]
我在我的 Wiki 中构建了一个非常广泛的表格,在列结构方面具有以下格式。是否可以在 Wiki 中插入一个计数器来跟踪此表中的列数? |- | 1||[Site Link]||Country 1|
我的 Confluence wiki 中有一个页面,它是通过脚本自动生成的,并通过其 API 被推送到 Confluence 中。因此我不需要这个页面的历史,因为页面版本的数量会很快增加。 有没有办法
是否可以在类似于 cloak macro 的 trac wiki 中显示和隐藏内容块?汇合的? 最佳答案 它已经几个月大了,但我想知道同样的事情。 Remy Blank 的回答让我走上了正轨,他只是错
我想将 100 多个 RTF 文件转换为 Wiki 标记,但我只能在网络上甚至在 StackOverflow 上找到“Wiki to RTF”转换器。 我只需要 RTF --> Wiki 标记 外面有
我是一名优秀的程序员,十分优秀!