使用 Anaconda 安装 Pygame [英] Install Pygame with Anaconda

查看:144
本文介绍了使用 Anaconda 安装 Pygame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 Mac 上安装 pygame 并遇到大量错误.我不是 100% 确定这告诉我什么,除了它告诉我很多.

是不是说 Pygame 只兼容 Python 3.5?因为 StackOverflow 上还有一张票(在 mac 上用 anaconda 安装 pygame)说 Python 3.5 有问题.如果它与 3.7 不兼容,我会感到惊讶.

如果不是不兼容,那是什么问题?我发现的所有问题和解决方案似乎都以 Windows 为中心.

% conda install -c cogsci pygame收集包元数据(current_repodata.json):完成求解环境:初始冻结求解失败.使用灵活的解决方法重试.解决环境:来自 current_repodata.json 的 repodata 失败,将使用下一个 repodata 源重试.收集包元数据(repodata.json):完成求解环境:初始冻结求解失败.使用灵活的解决方法重试.解决环境:-发现冲突!寻找不兼容的包.这可能需要几分钟时间.按 CTRL-C 中止.失败的UnsatisfiableError: 发现以下规格与您环境中现有的 python 安装不兼容:规格:- pygame ->蟒蛇[版本='2.7.*|3.5.*']你的蟒蛇:python=3.7如果 python 位于链的最左侧,那就是您要求的版本.当python出现在右边时,表示左边的东西不知何故不适用于您受限的 python 版本.请注意,conda 不会除非您明确指定,否则将您的 python 版本更改为不同的次要版本那.

解决方案

在使用 Anaconda 的 OS X 上,我让 pygame 在终端中工作:

<块引用>

conda 激活

<块引用>

pip 安装 pygame

I'm trying to install pygame on my Mac and get a ton of errors. I'm not 100% sure what this is telling me, except that it's telling me a lot.

Is it saying that Pygame is only compatible with Python 3.5? Because there was another ticket on StackOverflow (Install pygame with anaconda on mac) that said there was a problem with Python 3.5. I'd be surprised if it was incompatible with 3.7.

And if it's not incompatible, what's the problem? Everything I find seems to be quite Windows-centric with its problems and solutions.

% conda install -c cogsci pygame
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: - 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                          

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - pygame -> python[version='2.7.*|3.5.*']

Your python: python=3.7

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

解决方案

On OS X with Anaconda I got pygame to work in a terminal with:

conda activate

pip install pygame

这篇关于使用 Anaconda 安装 Pygame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆