- 帖子
- 2
- 精华
- 0
- 积分
- 12
- 阅读权限
- 10
- 注册时间
- 2016-9-2
- 最后登录
- 2016-9-5
|
请教一个问题,我用pyinstaller将这个打飞机的游戏打包成exe,总是出现以下报错:
c:\Users\Damon\Desktop>G_plane.exe
Traceback (most recent call last):
File "G_plane.py", line 81, in <module>
pygame.error: Couldn't open back.jpg
Failed to execute script G_plane
c:\Users\Damon\Desktop>G_plane-V2.exe
Traceback (most recent call last):
File "G_plane.py", line 81, in <module>
pygame.error: Couldn't open c:\hello\current\back.jpg
Failed to execute script G_plane
c:\Users\Damon\Desktop>G_plane.exe
Traceback (most recent call last):
File "G_plane.py", line 81, in <module>
pygame.error: Couldn't open c:/hello/current/back.jpg
Failed to execute script G_plane
上面尝试了三种路径方式,最后运行exe还是不行,但是这个代码再pycharm里面直接运行是没有问题的,在stack overflow上查到的,基本都说要么是路径之类的问题,测试了也不行。不知道是不是因为Python3.5的问题,Py3.5+win10 |
|