My favorites | Sign in
Project Home
Search
for
MacOSX_Install  

Featured
Updated Sep 16, 2011 by scoobygalletas

See here for instructions for Mac OS X Lion: Link

How to install in Mac OS X (Snow Leopard)

Introduction

There are many ways to install the requirements for Ninja-IDE to run. Here my aim will be to write a guide as straightforward as possible to get you runing Ninja in a glimpse. Then, I'll give a rough guide for more advanced or curious users than want to perform their own installation their way(for instance, using a virtualenv).

Details

We'll need to install the following:

  • Mercurial (to checkout and keep track of Ninja repo in Google Code).
  • Brew (a.k.a. "HomeBrew", an awesome Mac OS X package installer that resembles apt-get a lot)
  • Qt
  • PyQt

Install Mercurial

Install Brew

  • With this command, you get Brew installed to /usr/local.
NOTE: DO NOT RUN THIS COMMAND AS ROOT OR USING SUDO, RUN IT AS A COMMON USER!!
       $ ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"

HomeBrew project site: http://github.com/mxcl/homebrew

Install XCode

  • You can get the latest version of XCode from Apple here

Install sip, Qt and PyQt

  • From a console, run the following commands:
        $ brew install sip
        $ brew install qt
        $ brew install pyqt
        $ easy_install rope
        $ easy_install pygments

Note: Brew downloads the source of the packages and compiles it and as some of the above listed programs are quite big, it is natural for the compilation to take A BUNCH of time.

Check installations: To check the installation details for the packages you install using brew, run a command like this(in this example, for "pyqt" package):

MacBookPro:Cellar matias$ brew info pyqt
pyqt 4.8.3
http://www.riverbankcomputing.co.uk/software/pyqt
Depends on: sip, qt
/usr/local/Cellar/pyqt/4.7.7 (537 files, 19M)
/usr/local/Cellar/pyqt/4.8 (525 files, 19M)

This formula won't function until you amend your PYTHONPATH like so:
    export PYTHONPATH=/usr/local/lib/python:$PYTHONPATH

http://github.com/mxcl/homebrew/commits/master/Library/Formula/pyqt.rb

Checkout Ninja-IDE repository:

        $ hg clone https://ninja-ide.googlecode.com/hg/ ninja-ide 

Run Ninja

        $ cd ninja-ide
        $ python ninja.py

Note: If you get this error:

MacBookPro:ninja-ide matias$ python ninja.py 
Traceback (most recent call last):
  File "ninja.py", line 59, in <module>
    ninja_ide.setup_and_run()
  File "/Users/matias/Dev/ninja-ide/ninja_ide/__init__.py", line 40, in setup_and_run
    from ninja_ide import core, resources
  File "/Users/matias/Dev/ninja-ide/ninja_ide/core/__init__.py", line 4, in <module>
    from ninja_ide.core.core import run_ninja
  File "/Users/matias/Dev/ninja-ide/ninja_ide/core/core.py", line 6, in <module>
    from ninja_ide import gui
  File "/Users/matias/Dev/ninja-ide/ninja_ide/gui/__init__.py", line 1, in <module>
    import qt
  File "/Users/matias/Dev/ninja-ide/ninja_ide/gui/qt/__init__.py", line 1, in <module>
    from ide import IDE
  File "/Users/matias/Dev/ninja-ide/ninja_ide/gui/qt/ide.py", line 6, in <module>
    from PyQt4.QtGui import QMainWindow
ImportError: No module named PyQt4.QtGui

add this line to your ~/.profile file to amend your PYTHONPATH:

    export PYTHONPATH=/usr/local/lib/python:$PYTHONPATH
Powered by Google Project Hosting