首页 > 解决方案 > 我正在尝试将 pygame 安装到 PyCharm 中,但由于某种原因,我不断收到 ERROR: Command errored out with exit status 1:

问题描述

我不知道为什么会这样。在我遇到同样的错误之前,它说我没有安装轮包。所以我点了安装的轮子,我仍然有这个错误,但减去了部分。我会显示错误,但整体太长了。这是我认为导致问题的错误部分。

  Using cached pygame-1.9.6.tar.gz (3.2 MB)
Building wheels for collected packages: pygame
  Building wheel for pygame (setup.py): started
  Building wheel for pygame (setup.py): finished with status 'error'
  Running setup.py clean for pygame
Failed to build pygame
Installing collected packages: pygame
    Running setup.py install for pygame: started
    Running setup.py install for pygame: finished with status 'error'

DEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated. pip 20.3 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.
  ERROR: Command errored out with exit status 1:

虽然我确定它与 pip 有关,但我不知道如何解决这个问题。

标签: python-3.xmacospippygamepycharm

解决方案


好的,我不明白它为什么会起作用,但是我用 pip3 安装了 pygame,然后找到了保存 pygame 文件的文件夹并将其拖到存储模块文件的 PyCharm 文件夹中,它起作用了!我检查了 pycharms,该模块出现在解释器设置中。但是,我仍然希望我知道为什么会出现错误,因为在最后一次尝试中想出这个想法之前,我花了几个小时在谷歌搜索答案。同样出于某种原因,在我的 Mac 上,此安装命令不起作用:

pip3 install pygame

我不得不改用这个:

python3 -m pip install -U pygame==2.0.0.dev6 --user

推荐阅读