简体   繁体   English

在anaconda mac中安装pygame模块

[英]Installing pygame module in anaconda mac

I have Anaconda installed on my mac. 我的Mac上安装了Anaconda And it has messed with my pygame module. 它已经搞砸了我的pygame模块。

I tried following this tutorial and replacing pip3 install pygame with conda install pygame . 我尝试按照本教程使用 pip3 install pygame替换pip3 install pygame conda install pygame I have tried conda install pip and then pip install pygame yet i get the following error: 我试过conda install pip然后pip install pygame但是我得到以下错误:

Collecting pygame
  Could not find any downloads that satisfy the requirement pygame
  Some externally hosted files were ignored as access to them may be unreliable (use --allow-external pygame to allow).
  No distributions at all found for pygame

(ideas i got from this thread ) (我从这个帖子得到的想法)

Using the "pip install pygame" worked before i did the "conda install pip" however my default python is now the anaconda one and no longer accesses pygame. 在我执行“conda install pip”之前使用“pip install pygame”,但是我的默认python现在是anaconda,不再访问pygame。 Using which pip gives /Users/jensdonlin/anaconda/bin/pip 使用which pip /Users/jensdonlin/anaconda/bin/pip

Does anyone have some suggestions that would allow anaconda's version of python3 to access pygame? 有没有人有一些建议,允许anaconda的python3版本访问pygame?

Perhaps the answer involves use --allow-external pygame to allow but im not really sure how to use that. 也许答案涉及use --allow-external pygame to allow但我不确定如何使用它。

After 2 days of messing around with macports and homebrew with no joy, the instructions here worked for me using Anaconda Python 2.7.10 on a mac. 经过两天的macports和自制软件搞乱之后, 这里的说明适用于我在Mac上使用Anaconda Python 2.7.10。 Echoing them here in case the linked site ever disappears! 如果链接的网站消失,请在这里回复它们!

First open up terminal and enter these two lines: 首先打开终端并输入以下两行:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install sdl sdl_ttf sdl_image sdl_mixer portmidi

If you don't have binstar installed type: 如果您没有安装binstar类型:

conda install binstar

At this point it might tell you that The 'binstar' conda package has been renamed to 'anaconda-client' and that you have to type this instead: 此时它可能会告诉您“binstar”conda包已重命名为“anaconda-client” ,您必须输入以下内容:

conda install anaconda-client

Just do whatever it tells you to. 只要做它告诉你的任何事情。 Then finally, type: 最后,键入:

conda install -c https://conda.binstar.org/quasiben pygame

and hopefully you're done! 希望你已经完成了!

The problem here is that the pygame developers have not uploaded pygame to PyPI. 这里的问题是pygame开发人员没有将pygame上传到PyPI。 So to install it, you will have to download it and pip install the downloaded source, as described in the tutorial you linked. 因此,要安装它,您必须下载并点击安装下载的源,如您链接的教程中所述。 You can do this within the Anaconda Python. 你可以在Anaconda Python中做到这一点。 Note that in the Anaconda Python, even if it is Python 3, pip is just called pip , not pip3 . 请注意,在Anaconda Python中,即使它是Python 3,pip也只是称为pip ,而不是pip3

i've tried many permutations of pip. 我尝试了许多pip的排列。 the problem is i wasn't specifying the file path i was trying pip install pygame . 问题是我没有指定我正在尝试pip install pygame的文件路径。 I have now successfully installed pygame by following the tutorial I gave above and using: pip install /Users/YOURNAME/Downloads/pygame 我已经按照上面给出的教程成功安装了pygame并使用: pip install /Users/YOURNAME/Downloads/pygame

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM