错误:
File "/home/alien/cncell/core/animator.py", line 413, in create_animation_from_data
pygame.image.save(screen, image_fp)
pygame.error: SavePNG: could not create png write struct
可能的提示A:我现在在Ubuntu上。我在Windows上运行相同的脚本时没有这个问题。在
可能的提示B:当第一次调用pygame.image.save
时,libpng
生成以下警告:
libpng warning: Application built with libpng-1.2.51 but running with 1.6.17
我该怎么解决这个问题?在
我试过的一些事情:
1)我可以加载PNG吗?是的
2)python -m pygame.tests
结果:
这些测试的结果让我认为这个问题不太可能是由于我的代码从Windows移植到Ubuntu的特定问题造成的(例如,我试图修复路径名等,只要有可能,pygame
测试应该是独立于平台的,但仍然失败吗?)。在
这个问题是由于I installed my Python stack using Anaconda引起的,但是installed ^{} using the build+install instructions for Ubuntu on ^{}'s documentation page 。在
这导致了
libpng
的冲突库,我想,不知怎么的。在无论如何,这个问题是通过以下方式解决的:
1)删除pygame(因为我使用
pip
来安装pygame,pip uninstall pygame
完成了这个任务)2)安装} repositories
pygame
using a build some kind soul had contributed to the ^{然后,运行
python -m pygame.tests
时没有报告任何错误,除了:为了这个目的,我是可以的。在
相关问题 更多 >
编程相关推荐