【问题标题】:When trying to install pygame on Anaconda Python 3.x is downgraded to Python 2.7尝试在 Anaconda 上安装 pygame 时,Python 3.x 被降级为 Python 2.7
【发布时间】:2019-09-14 07:37:28
【问题描述】:

我正在使用 Anaconda Python 3。 我正在尝试安装 pyOpenGL、Vpython 和 pygame。

使用conda install 安装 pyOpenGL 和 Vpython 很好。 当我尝试使用 conda install 安装 Pygame 时,它​​显示:

conda install -c https://conda.binstar.org/kne pygame

#same for conda install pygame

...

The following NEW packages will be INSTALLED:

.
.
.

The following packages will be REMOVED:

  backports.os-0.1.1-py37_0
  importlib_metadata-0.8-py37_0
  jeepney-0.4-py37_0
  jupyterlab_server-0.2.0-py37_0
  secretstorage-3.1.1-py37_0
  wurlitzer-1.0.2-py37_0

The following packages will be UPDATED:

.
.
.

The following packages will be DOWNGRADED:
.
.
.
python                                   3.7.3-h0371630_0 --> 2.7.16-h9bab390_0
.
.
.

因此,如果我决定安装 pygame,我会将 python3 降级到 python 2.7,并且无法使用 pyOpenGL。 有没有办法在这种环境下安装pygame而不降级python?

【问题讨论】:

  • 我使用 CPython 但我安装了 Anaconda3。在带有conda 的文件夹中,我还有pip 并使用pip install pygame 我可以在Anaconda 中为python 3.7 安装pygame
  • @furas 我试过 pip,但它也要求降级。解决方案是创建一个新的 conda 环境并安装 OpenpyGL,而不是 Vpython、pygame 和后来的 spyder。在 python 3.5 上。感谢您的帮助!

标签: python-3.x pygame conda pyopengl


【解决方案1】:

这意味着您尝试安装它的渠道(即kne)没有可用于 Python 3.7 的 Pygame 包。由于可用的最后一个版本适用于 Python 3.5,因此您需要为该 Python 版本创建一个 conda 环境并在其上安装 Pygame。

【讨论】:

  • 我创建了一个新的 Conda 环境,现在可以正常工作了!非常感谢!
猜你喜欢
  • 2014-06-17
  • 2017-08-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-26
  • 2023-03-31
  • 2014-11-19
相关资源
最近更新 更多