Pygame “No module called pygame.base”

后端 未结 5 1778
无人及你
无人及你 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 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.

提交回复
热议问题