python-3.x - 我正在尝试将 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 有关,但我不知道如何解决这个问题。
解决方案
好的,我不明白它为什么会起作用,但是我用 pip3 安装了 pygame,然后找到了保存 pygame 文件的文件夹并将其拖到存储模块文件的 PyCharm 文件夹中,它起作用了!我检查了 pycharms,该模块出现在解释器设置中。但是,我仍然希望我知道为什么会出现错误,因为在最后一次尝试中想出这个想法之前,我花了几个小时在谷歌搜索答案。同样出于某种原因,在我的 Mac 上,此安装命令不起作用:
pip3 install pygame
我不得不改用这个:
python3 -m pip install -U pygame==2.0.0.dev6 --user
推荐阅读
- python - 如何将日期+时间转换为时间戳?- Python
- julia - Julia:什么时候在微分方程系统中输入真或假?
- android - 我的“If”语句在 dart/flutter 中不起作用
- ruby-on-rails - Rails 自行向请求添加未经许可的参数
- python - 使用oneliner更新for循环中的变量
- python-3.x - 计算矩阵值到目标矩阵 Numpy 向量化的距离
- reactjs - 当我单击 ReactJS 中的按钮时,我想在默认颜色和“蓝色”颜色之间切换
- algorithm - 谁能解释以下代码的时间复杂度
- python - 端口漏洞扫描程序未捕获 http 横幅
- intellij-idea - Intellij IDEA 在成功运行单元测试后创建了一个名为 BASE_DIR_IS_UNDEFINED 的文件夹