如何在出现错误 "no such option: --build-dir" 的 PyCharm 中安装 Pygame

How to install Pygame in PyCharm with error "no such option: --build-dir"

我创建了一个 PyCharm 项目,将 pip 更新为 22.0.4 并将 setuptools 更新为 62.0.0(均为最新版本)。当我转到项目设置>项目解释器>安装并尝试安装 pygame 时,它会抛出以下错误:

Executed command: pip install pygame

Error occured: Non-zero exit code (2)

Proposed solution: Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Users\geema\PycharmProjects\smallgame\venv\Scripts\python.exe'.

Usage:   
  C:\Users\geema\PycharmProjects\smallgame\venv\Scripts\python.exe -m pip install [options] <requirement specifier> [package-index-options] ...

  C:\Users\geema\PycharmProjects\smallgame\venv\Scripts\python.exe -m pip install [options] -r <requirements file> [package-index-options] ...

  C:\Users\geema\PycharmProjects\smallgame\venv\Scripts\python.exe -m pip install [options] [-e] <vcs project url> ...

  C:\Users\geema\PycharmProjects\smallgame\venv\Scripts\python.exe -m pip install [options] [-e] <local project path> ...

  C:\Users\geema\PycharmProjects\smallgame\venv\Scripts\python.exe -m pip install [options] <archive url/path> ...

no such option: --build-dir

我该如何解决这个问题?

我设法简单地在我当前的项目上使用了另一个项目的解释器,并且解释器上有 Pygame。我仍然不确定为什么会发生错误。