Forums

I think this file runs on python3. How do I upgrade

Hello, this is a project that I can't credit for but it runs on Python 3. I'll bear the fact that most of my scripts may wobble but can you upgrade me to python 3, please?

https://www.pythonanywhere.com/user/elksie5000/files/home/elksie5000/mysite/hobby/planets?edit

Stack trace:

ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
Traceback (most recent call last):
  File "/home/elksie5000/mysite/hobby/planets", line 6, in <module>
    WIN = pygame.display.set_mode((WIDTH, HEIGHT))
error: No available video device

You're on a very old system image -- you can upgrade to more recent one which supports Python up to 3.9 (see: https://help.pythonanywhere.com/pages/ChangingSystemImage/). Ther error which you're getting, however, is most probably related to the fact, that PythonAnywhere is a headless environment (non-GUI), so there's no screen attached. Hence pygame will not run properly on PA.