Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named _view #1

Open
dongyuwei opened this issue Jul 9, 2019 · 4 comments
Open

ImportError: No module named _view #1

dongyuwei opened this issue Jul 9, 2019 · 4 comments

Comments

@dongyuwei
Copy link

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?

@LingDong-
Copy link
Owner

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.

@dongyuwei
Copy link
Author

Thanks for your quick reply.
The exception disappeared, it prints a loaded log. But the window keeps blank.

@dongyuwei
Copy link
Author

It would be better to use virtualenv and lockdown all the dependencies.

@bolechen
Copy link

Thanks for your quick reply.
The exception disappeared, it prints a loaded log. But the window keeps blank.

+1, any workarounds?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants