我正在尝试在PyCharm中安装pygame。在PyCharm终端中运行pip install pygame
时,我得到error: command 'gcc' failed with exit status 1
。
我尝试了他们所解释的here,但结果却不成功。当我同时运行sudo apt-get install python-dev
和sudo apt-get install python3-dev
时,我得到了sudo: apt-get: command not found
。
顺便说一下,我正在使用macOS Mojave版本10.14.5。我在PyCharm中使用anaconda解释器。
当我进入macOS终端并运行pip install pygame
时,我已经安装了它,但是它似乎与PyCharm anaconda解释器不同步。在两个终端上运行pip list
时,我得到的结果完全不同。
我是初学者,所以如果不清楚或在这里做错了什么请原谅我。