Pygame “No module called pygame.base”

陌路散爱 提交于 2020-01-07 03:10:42

问题


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


来源:https://stackoverflow.com/questions/40224385/pygame-no-module-called-pygame-base

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!