pygame-web.github.io
pygame-web.github.io copied to clipboard
mention pygame.surfarray in wiki
basically instead of using import pygame
and pygame.surfarray
you have to import pygame.surfarray
and specifically mention it in the pygbag-code section
In the doc it is specified that when numpy is required, it must be explicitely imported, and that before anything else.
Some modules from pygame need implicit import of numpy, which is against PEP20 Zen of Python "explicit is better than implicit". Implicit can only work when numpy is already installed ( desktop case ) : this is not the case in pygbag : everything that can be detected is downloaded then installed as nothing is installed by default.
This is not specific to pygame, it is the same for any module that has a requirement chain.