【问题标题】:cannot import pygame on pycharm - linux无法在 pycharm 上导入 pygame - linux
【发布时间】:2016-07-19 21:24:54
【问题描述】:

我正在尝试在 pycharm 上导入 pygame,我已经安装了 pygame,当我通过命令行执行程序时它会运行,但是当我尝试从 pycharm 使用它时它不起作用。我尝试将其添加到项目解释器中,但出现错误:

Non-zero exit code (1) Collecting Pygame No matching distribution found for Pygame the requirement Pygame (from versions: )

还从命令行尝试了pip install Pygame,但发生了: Collecting Pygame Could not find a version that satisfies the requirement Pygame (from versions: ) No matching distribution found for Pygame

我正在运行 python 3.5 和 pygame v1.9.1 并且 pycharm 已更新。 操作系统:Linux Mint 17.3

【问题讨论】:

  • type import pygame at the top at a python file in pycharm ...当 pycharm 用红色下划线时,单击它,使光标位于单词 pygame 上(即,如果您输入了它会让 pygame 说一个不同的词)...按 alt+enter,选择“安装丢失的包”选项...pycharm 将确保它可用于您正在使用的解释器...
  • 要为python 3安装它,你必须使用pip3 install
  • 总是同样的错误:非零退出代码(1)

标签: python python-3.x pygame pycharm


【解决方案1】:

我通过卸载并重新安装 pygame 解决了这个问题,确保正确解决 wiki 解释的所有依赖项

【讨论】:

    猜你喜欢
    • 2020-10-03
    • 2020-05-30
    • 2018-12-09
    • 1970-01-01
    • 2019-05-03
    • 2018-09-17
    • 1970-01-01
    • 1970-01-01
    • 2020-04-07
    相关资源
    最近更新 更多