pygame的安装遇到的问题。

pygame的安装:

1、安装
在termina中直接输入下面命令就能安装好了:
pip install pygame

2、遇到的问题
出现问题:Distributed 1.21.8 requires msgpack, which is not installed
解决:
First Method: Run this command:
conda install -c anaconda msgpack-python
Second Method: Run this command:
pip install msgpack
在次执行上面的命令出现:grin 1.2.1 requires argparse>=1.1, which is not installed.
解决:
pip install argparse

3、最后执行操作
在执行pip install pygame 就可以了。

4、如果是python3 , 并且是使用anaconda, 执行下面命令:
anaconda search -t conda pygame
For Python 3 use the following:

conda install -c https://conda.binstar.org/kne pygame
conda create -n pygameenv -c cogsci pygame

5、(本人使用就是这个方案)如果上面的方法还是不行的话, 可以直接到conda 的环境下面找对应的Python 版本进行操作, 具体如图1所示:
这里写图片描述

在py36 的bin 目录下面执行命令:

/xxx/xxx/envs/py36/bin/pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pygame

其中/xxx/xxx是 本人自己安装conda 的目录,-i 后面的参数,表示的是使用清华大学的国内镜像下载, 如果安装过程中出现如下错误:

You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the ‘pip install –upgrade pip’ command.

就在当前的目录下面执命令:./pip install –upgrade pip
在执行命令:

/xxx/xxx/envs/py36/bin/pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pygame
就可以安装成功了。




参考地址:
https://stackoverflow.com/questions/51050257/distributed-1-21-8-requires-msgpack-which-is-not-installed

https://stackoverflow.com/questions/48972603/installing-pygame-for-python3-in-mac-using-anaconda

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值