compiler-errors - 如何克服python的编译(Nuitka)错误

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

我才刚刚开始了解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

请帮我解决这个问题!!!

最佳答案

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

  • 大写P不会打印在Python中。建
    in函数以小写p开头。
  • 不应缩进单行程序。
  • 关于compiler-errors - 如何克服python的编译(Nuitka)错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45740192/

    相关文章:

    python - 如何运行 Nuitka 编译的 Python 可执行文件

    Swift for in 带括号的循环

    c++ - Solaris 12.3 C++ 编译器内存不足

    compiler-errors - 如何从opencv gpumat创建推力device_vector

    python-3.6 - ModuleNotFoundError : No module named 'debug_toolbar'

    python - 非常基本。涉及nuitka?

    java - JGroups 'cannot find symbol'

    python - 语法错误 : name 'cows' is assigned to before global declaration in Python3. 6

    python - 使用 cx_freeze 的 .py 到 .exe 会导致错误

    python - 类型错误 : type 'types.GenericAlias' is not an acceptable base type