我有一个 cythonized 应用程序,直到昨天它还在编译和运行完全正常。
现在,突然,当尝试编译(在 DigitalOcean 上运行的 Ubuntu 20 服务器)时,我得到了这个:
creating build/temp.linux-x86_64-3.8
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/var/www/anagami_console/anagami/anagamienv/include -I/usr/include/python3.8 -c event.c -o build/temp.linux-x86_64-3.8/event.o
x86_64-linux-gnu-gcc: fatal error: Killed signal terminated program cc1
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
相同的代码使用 python 3.9 在我的 Windows 桌面上编译和运行完美。我得到的错误信息不是特别丰富,所以我真的不知道在哪里看
最佳答案
修复它的方法是删除每个 .c 和 .pyd 文件并重新编译。我仍然不确定是什么导致了原始错误 - 但删除 + 进行全新的重新编译修复了它
关于python - Cython 编译突然开始失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69802421/