How to install SimpleCV on OSX 10.8

99封情书 提交于 2019-12-11 05:27:23

问题


I believe SimpleCV has installed correctly. When I run:

       sudo pip install SimpleCV 

And then in python try to import the library, I run into this error:

       ImportError: No module named 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

What am I missing? How should I try to install SimpleCV and pygame? Or do I even need pygame to run SimpleCV in python?


回答1:


Yes, you need pygame. These instructions worked for me: http://juliaelman.com/blog/2013/04/02/installing-pygame-on-osx-mountain-lion/

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

You will need XCode, XQuartz, Mercurial (hg) and homebrew to install them.

Finally you will be able to pip install pygame through that command:

sudo pip install hg+http://bitbucket.org/pygame/pygame

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 Python distribution (you really should, it's an excellent, tidy, and painless way to get the full Python numeric/scientific stack), in which case a search for 'opencv anaconda osx 10.8.4' will bring up my detailed instructions.



来源:https://stackoverflow.com/questions/18294242/how-to-install-simplecv-on-osx-10-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!