Hermit
Hermit copied to clipboard
ImportError: No module named _view
python main.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "main.py", line 18, in <module>
import pygame._view
ImportError: No module named _view
tested with Python 2.7.16
Hi @LingDong- , can you provide your pip requirements.txt?
Hi there, it appears that the newer versions of pygame no longer have _view
module, but the fix turned out be super simple: Just comment out that line in main.py
and it will work! Just tested on 2.7.15 and pygame 1.9.4.
import pygame
# import pygame._view #<--- comment out this line
import numpy
I haven't ran the project for a while myself, and it seems that it is more laggy than it used to be, and the loading screen is blank. Something must have changed with pygame over the years. Will look into it when I have time.
Thanks.
Thanks for your quick reply.
The exception disappeared, it prints a loaded
log. But the window keeps blank.
It would be better to use virtualenv and lockdown all the dependencies.
Thanks for your quick reply. The exception disappeared, it prints a
loaded
log. But the window keeps blank.
+1, any workarounds?