【问题标题】:I am trying to install pygame into PyCharm but for some reason, I keep getting ERROR: Command errored out with exit status 1:我正在尝试将 pygame 安装到 PyCharm 中,但由于某种原因,我不断收到 ERROR: Command errored out with exit status 1:
【发布时间】:2020-09-01 19:07:34
【问题描述】:

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

  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.x macos pip pygame pycharm


    【解决方案1】:

    您可以按照以下步骤操作:- 发生这种情况是因为您在 Pycharm 中的解释器未设置为正确的解释器。

    第 1 步:您必须转到位于 pycharm 窗口最右上角的编辑配置按钮,然后单击它后从列表中选择您想要的解释器。

    第 2 步:转到系统设置(在 Windows 中)或系统偏好设置(在 Mac 中),然后从下拉菜单中选择项目解释器。从那里,您可以更改解释器设置以及从“+”号安装软件包。在此,您还可以看到已安装到所选解释器中的模块,因此请选择可以看到已安装 pygame 的解释器。

    【讨论】:

    • 问题是由于某种原因我无法安装pygame模块。在我的问题中,我粘贴了我认为解决方案但我不明白它告诉我做什么的错误消息部分
    【解决方案2】:

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

    pip3 install pygame
    

    我不得不改用这个:

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

    【讨论】:

      猜你喜欢
      • 2021-11-07
      • 2020-10-04
      • 2020-09-24
      • 1970-01-01
      • 2011-08-20
      • 2021-07-10
      • 2015-11-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多