python - 无法使用 conda 安装 Pygame
问题描述
我试图使用 conda 安装 Pygame 模块。
我使用了这个命令:
conda install pygame
它给了我以下错误:
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- pygame
Current channels:
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
然后我使用了以下命令:
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.
Examining python=3.7: 100%|██████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 11.12it/s]-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.
我已经使用 conda install 安装了不同的模块,例如 tensorflow、numpy、pandas、matplotlib,它们都在工作,但它在 pygame 中给了我一个错误。如何修复它并安装 Pygame?
解决方案
pygame 包已有cogsci
4 年历史,仅与 python2.7 兼容。如果您想要最新版本,请使用pip install pygame
. evindunn
我个人使用仅适用于 linux-64的 conda 包
推荐阅读
- sql-server - 如何使用带有游标的 sql 来创建 SSIS 包?
- gitlab - 在服务器上安装 gitlab runner,但作为多个不同的用户
- c - MATLAB/Simulink - C MEX S-Function:总线信号和涉及指针的传统 C 结构之间的转换
- sql - 如何在 SQL 中使用 SQL 条件语句
- docker - Last Docker Desktop for Windows 安装崩溃
- r - 在 R 中将 %H:%M:%S 添加为 as.POSIXct 格式
- android - Android在使用谷歌日历api时给IOException“无法创建目录:/tokens”
- r - 在 R 中的数据框的每个元素上应用带有参数的函数
- throw - 我不是程序员:“throw”是指特定的代码元素还是像“show”这样的通用术语?
- csv - # 在 CSV 标题中