Pygame “No module called pygame.base”

2019-09-16 11:31发布

问题:

When I download pygame-1.9.2b8-cp36-cp36m-win32.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame I turn it into zip, take the headers in the pygame-1.9.2b8.data folder into pygame34/include/pygame and I put the other pygame file from the zip in the site-packages folder together with pygame-1.9.2b8.data as any tutorial shows, I always get this error:

Traceback (most recent call last):
  File "C:/Users/andsa/PycharmProjects/THIS WORKS ANDREAS/Games.py", line 1, in <module> 
    import pygame
  File "C:\Python34\lib\site-packages\pygame\__init__.py", line 141, in <module>
    from pygame.base import *
ImportError: No module named 'pygame.base'

EDIT: I use python 3.4.5, I have tried both python and pygame 64 and 32 bit but i still get this error

回答1:

try usin pip3 install pygames to install pygames

pip3 install pygame


回答2:

Use pip3 tool to reinstall the pygame python module:

C:\Python373\Scripts>pip3 uninstall pygame
C:\Python373\Scripts>pip3 install pygame

Then install it:

C:\Python373\Scripts>pip install pygame-menu==2.0.1