conda install pygame时报错,按网上办法,更新conda、anaconda,pip install,conda install -c conda-forge 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://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/osx-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/osx-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
- https://repo.anaconda.com/pkgs/main/osx-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/osx-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://conda.anaconda.org/conda-forge/osx-64
- https://conda.anaconda.org/conda-forge/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.
解决办法:
1 搜索包
anaconda search -t conda pygame 【conda search pygame是搜索不到的,没搜索到具体原因,欢迎知晓的人士指教】
platforms为适用的操作系统,Builds为适用的python版本
#app @ user1 in ~ [15:22:44]
$ anaconda search -t conda pygame
Using Anaconda API: https://api.anaconda.org
Packages:
Name | Version | Package Types | Platforms | Builds
------------------------- | ------ | --------------- | --------------- | ----------
CogSci/pygame | 1.9.2a0 | conda | linux-64, win-32, osx-64, win-64 | py35_0, py27_0
: Python library based on SDL for making games
Fadox45/pygame | 1.9.2a0 | conda | win-64 | py35_0
Maceo57/pygame | 1.9.2a0 | conda | osx-64 | py35_0
auto/pygamess | 0.3.0 | conda | linux-64 | py27_0
: https://github.com/kzfm/pygamess
Run 'anaconda show <USER/PACKAGE>' to get installation details
2 搜索包详情
anaconda show CogSci/pygame
$ anaconda show CogSci/pygame
Using Anaconda API: https://api.anaconda.org
Name: pygame
Summary: Python library based on SDL for making games
Access: public
Package Types: conda
Versions:
+ 1.9.2a0
To install this package with conda run:
conda install --channel https://conda.anaconda.org/CogSci pygame
3 安装包
conda install --channel https://conda.anaconda.org/CogSci pygame
注意注意:
此包适用的python版本是py35_0, py27_0,conda的优点是会自动安装所依赖的python版本。我当前版本是3.7,所以最好自己再创建一个不同python版本的虚拟环境。
创建不同版本的python环境 https://blog.csdn.net/qq_41933542/article/details/105889790