首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何克服python的此编译(Nuitka)错误

如何克服python的此编译(Nuitka)错误
EN

Stack Overflow用户
提问于 2017-08-17 16:12:32
回答 1查看 860关注 0票数 0

我刚刚开始了解python语言,我只知道基本知识。在使用nuitka在ubuntu中编译一个小命令时,我发现了问题。

注意:我在这里使用的python版本是python3.6,这里是我的$ sample.py $。

代码语言:javascript
复制
    Print ("Hello user.")

这是我用来编译代码的命令行..。

代码语言:javascript
复制
    nuitka --recurse-on --python-version=3.6 sample.py

当我使用这个命令时,我得到这个作为输出..。

代码语言:javascript
复制
sample.build/CompiledAsyncgenType.c: In function
‘Nuitka_Asyncgen_unwrap_value’:
sample.build/CompiledAsyncgenType.c:994:9: warning: implicit declaration              
of function ‘_PyGen_SetStopIterationValue’ [-Wimplicit-function-declaration]
     _PyGen_SetStopIterationValue(((_PyAsyncGenWrappedValue*)result)->agw_val );            

     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
sample.build/CompiledAsyncgenType.o: In function     
`Nuitka_Asyncgen_unwrap_value.isra.9':
CompiledAsyncgenType.c:(.text+0x118c): undefined reference to     
`_PyGen_SetStopIterationValue'
sample.build/CompiledAsyncgenType.o: In function  
`Nuitka_AsyncgenAsend_throw':
CompiledAsyncgenType.c:(.text+0x2337): undefined reference to     
`_PyGen_SetStopIterationValue'
sample.build/CompiledAsyncgenType.o: In function  
`Nuitka_AsyncgenAthrow_throw':
CompiledAsyncgenType.c:(.text+0x295f): undefined reference to    
`_PyGen_SetStopIterationValue'
sample.build/CompiledAsyncgenType.o: In function   
`Nuitka_AsyncgenAthrow_iternext':
CompiledAsyncgenType.c:(.text+0x30e8): undefined reference to    
`_PyGen_SetStopIterationValue'
sample.build/CompiledAsyncgenType.o: In function   
`Nuitka_AsyncgenAsend_tp_iternext':
CompiledAsyncgenType.c:(.text+0x37b7): undefined reference to     
`_PyGen_SetStopIterationValue'
sample.build/CompiledAsyncgenType.o:CompiledAsyncgenType.c:(.text+0x3fe7):    
more undefined references to `_PyGen_SetStopIterationValue' follow
collect2: error: ld returned 1 exit status
scons: *** [sample.exe] Error 1

伙计们,请帮我解决这个问题!

EN

回答 1

Stack Overflow用户

发布于 2017-08-25 16:43:35

在CPython (参考实现)中有两个问题也会导致失败。

  1. 带有大写字母P的打印没有内置到Python中。内置函数以小写p开头。
  2. 单行程序不应缩进。
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45740192

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档