Pygame “No module called pygame.base”

后端 未结 5 1759
无人及你
无人及你 2020-12-21 05:55

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 fo

相关标签:
5条回答
  • 2020-12-21 05:59

    You probably have python installed for 32-bit. Uninstall and the install the 64-bit version. After that,

    pip3 uninstall pygame

    pip3 install pygame

    0 讨论(0)
  • 2020-12-21 06:02

    try usin pip3 install pygames to install pygames

    pip3 install pygame
    
    0 讨论(0)
  • 2020-12-21 06:10

    MACOS SOLUTION

    This might work for all operating systems, I am not quite sure.

    A long explanation short. Pygame comes pre-installed with all newer versions of Python which may or may not cause directory management a bit confusing and hard for your OS to handle. When you reinstall/install Pygame via pip3 install pygame Many instances of the same Pygame directory are created on your computer. You have to manually find them and delete them. I've deleted one of the instances from the following directory on my MAC:

    /Library/Frameworks/Python.framework/versions/3.8/lib/Python3.8

    I found the pygame directory and deleted it and then pygame started working in pycharm and in IDLE.

    So for this question what I recommend is to delete the pygame directory from this directory that the error message is pointing to. Prior to the steps I've pointed out in my solution.

    0 讨论(0)
  • 2020-12-21 06:12

    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
    
    0 讨论(0)
  • This error bugged me for months, what i did was:

    1. Uninstalled the package

      pip3 uninstall pygame

    2. Purged the pip cache

      pip cache purge

    3. Finally...Reinstalled pygame using pip3

      pip3 install pygame

    Worked like a charm :)

    0 讨论(0)
提交回复
热议问题