【问题标题】:How to overcome this compilation(Nuitka) error for python如何克服python的这个编译(Nuitka)错误
【发布时间】:2017-08-17 16:12:32
【问题描述】:

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

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

    Print ("Hello user.")

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

    nuitka --recurse-on --python-version=3.6 sample.py

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

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

请大家帮我解决这个问题!!...

【问题讨论】:

    标签: compiler-errors python-3.6 nuitka ubuntu-16.10


    【解决方案1】:

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

    1. Python 中没有内置大写 P 的打印。建成的 in 函数以小写 p 开头。
    2. 单行程序不应缩进。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-09-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多