问题描述
我相信SimpleCV已正确安装.当我跑步时:
I believe SimpleCV has installed correctly. When I run:
sudo pip install SimpleCV
然后在python中尝试导入该库,我遇到此错误:
And then in python try to import the library, I run into this error:
ImportError: No module named pygame
是否需要pygame运行SimpleCV?我本来不会这么想的,所以我尝试使用pip安装pygame时,我又遇到了另一个错误,说我的链接或其他内容不正确:
Is pygame required to run SimpleCV? I wouldnt have thought so, so then I try to use pip to install pygame and I get another error, saying I have a bad link or something:
TTP error 400 while getting http://www.pygame.org/../../ftp/pygame-1.6.2.tar.bz2 (from http://www.pygame.org/download.shtml)
Could not install requirement pygame because of error HTTP Error 400: Bad Request
我想念什么?我应该如何尝试安装SimpleCV和pygame?还是我甚至需要pygame在python中运行SimpleCV?
What am I missing? How should I try to install SimpleCV and pygame? Or do I even need pygame to run SimpleCV in python?
推荐答案
是的,您需要pygame.这些说明对我有用: http://juliaelman.com/blog/2013/04/02/installing-pygame-on-osx-mountain-lion/
Yes, you need pygame. These instructions worked for me: http://juliaelman.com/blog/2013/04/02/installing-pygame-on-osx-mountain-lion/
它们会引导您安装许多pygame依赖项(SimpleCV和OpenCV也需要):
They lead you through installing a number of pygame dependencies(which SimpleCV and OpenCV need as well):
brew install sdl sdl_image sdl_mixer sdl_ttf portmidi
brew tap homebrew/headonly
brew install smpeg --HEAD
您将需要XCode,XQuartz,Mercurial(hg)和自制软件来安装它们.
You will need XCode, XQuartz, Mercurial (hg) and homebrew to install them.
最后,您将可以通过该命令pip install
pygame:
Finally you will be able to pip install
pygame through that command:
sudo pip install hg+http://bitbucket.org/pygame/pygame
一旦安装了pygame,就可以开始安装OpenCV的噩梦(SimpleCV也需要).那里有很多相互矛盾的食谱,除非您使用anaconda Python,否则我的帮助不会对您有所帮助分布(您确实应该,它非常出色,整洁且无痛获取完整的Python数字/科学堆栈的方法),在这种情况下,将出现对"opencv anaconda osx 10.8.4"的搜索我的详细说明.
Once pygame is installed, you can begin the nightmare of installing OpenCV(also needed by SimpleCV). There are many conflicting recipes out there,and mine won't help you unless you are working with an anaconda Pythondistribution (you really should, it's an excellent, tidy, and painlessway to get the full Python numeric/scientific stack),in which case a search for 'opencv anaconda osx 10.8.4' will bring upmy detailed instructions.
这篇关于如何在OSX 10.8上安装SimpleCV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!