我很奇怪地无法在python中安装pygame在conda环境中进行游戏开发

发布于 2025-01-21 06:12:03 字数 1048 浏览 0 评论 0原文

我正在学习Python,并且已经切换到Anaconda,因为它提供了比普通版本更多的支持和预安装的库。就在我开始从pygame开始时,我在Anaconda提示中的错误尝试安装:

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.

请帮助我访问Pygame,因为我的朋友在使用它时没有问题,我尝试重新安装,但即使那也不是't帮助

I'm learning Python and have switched to Anaconda for it provides much more support and pre-installed libraries than the normal version. Just as I begin to start with pygame, I've this error in Anaconda Prompt trying to install it:

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.

Please help me to access pygame as my friends have no problem in working with it, and I tried re-installing, but even that doesn't helps.????

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

メ斷腸人バ 2025-01-28 06:12:04

如果您遵循错误消息中的建议,然后到达anaconda.org并输入pygame,则发现默认频道无法从中获得。如果要使用conda进行安装,唯一的选择是使用可用的通道之一,例如cogsci。因此,为了为您的游戏开发创建环境,您可以这样做:

conda create -n pygame -c CogSci pygame

或者,如果要安装到现有环境(请注意,为单独的项目具有单独的环境是建议的),那么您可以使用

conda install -c CogSci pygame

Note安装PyGame,尽管该频道中的版本超过5年。另一种选择是您可以使用PIP安装Pygame:#

pip install pygame

If you follow the suggestion in the error message and got to anaconda.org and enter pygame, then you find that it is not available from the default channel. The only option, if you want to install using conda, would be to use one of the channels from which it is available, e.g. CogSci. So to create an environment for your game development, you could for example do:

conda create -n pygame -c CogSci pygame

or, if you want to install to an existing environment (note that having a seperate environment for seperate projects is advisbale), then you can install pygame with

conda install -c CogSci pygame

Note though that the version in that channel is over 5 years old. An alternative is that you could install pygame using pip:#

pip install pygame
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文