Mostrando entradas con la etiqueta ninja. Mostrar todas las entradas
Mostrando entradas con la etiqueta ninja. Mostrar todas las entradas

9 de septiembre de 2011

Cómo Instalar NINJA IDE en Mac OS X Lion

Hace poquito actualicé mi compu a Lion y reinstalé NINJA. Con Diego Sarmentero hicimos luego una mini-sprint para dejar NINJA andando aceitadamente y bien nativo en Mac.

Acá les dejo las instrucciones para instalar NINJA desde el repositorio en desarrollo:

  1. Instalar XCode desde el App Store:
    • http://itunes.apple.com/us/app/xcode/id448457090?mt=12
  2. Instalar HomeBrew:
    • https://github.com/mxcl/homebrew/wiki/Installation
  3. Instalar Qt y PyQt:
    • $ brew install qt
    • $ brew install pyqt
    • Agregar esta línea en el archivo ~/.profile:
      • export PYTHONPATH=/usr/local/lib/python:$PYTHONPATH
  4. Hacer un checkout del repositorio de NINJA:
    • Hace falta tener instalado Mercurial para hacer el clone del repositorio. Si no lo tenés instalado, lo podés instalar así:
      • sudo easy_install mercurial
  5. Ejecutar NINJA:
    • Vamos a la carpeta del checkout:
      • $ cd ~/NINJA_IDE/ninja-ide/
      •  $ python ninja-ide.py

Y ahora, a disfrutar de NINJA-IDE!

7 de septiembre de 2011

Mac OS X Lion, Python, Django and how I'm happier now with my computer


I recently upgraded my MacBook Pro from Snow Leopard to Lion.

The idea of the upgrade unsettled me quite a bit since I use my computer to work and having it off due to OS or setup issues was not an option. Basically I was worried about having problems to install Python packages(I work mostly as a Django/Python developer, and I use a bunch of stuff from PyPi and quite a few Django pluggables) and I've already had some nasty problems installing, for instance, the MySQL connector in the past in Snow Leopard.

After some hesitation, I finally got myself to the task of upgrading.

After I upgraded, I did all the setup of the Python stuff: all the virtualenvs, Python/Django packages, the requirements for NINJA-IDE, everything WORKED PERFECT. I did not have a single issue. Nor even a single one. I'm happy this of not having to write a long, strange and tricky post saying something like "yes, it is a huge pain in the... patience", because it is just not. Everything work perfect.

I believe that the root cause of the difference relies in Mac OS Lion to came bundled with 64-bit versions of Python pre-installed:

It has, pre-installed:

  • 32-bit Python 2.5
  • 64-bit Python 2.6 (I use this one for work)
  • 64-bit Python 2.7 (I use this for NINJA-IDE, both for running it and to develop the code I write for it)

That's good new that Apple got its OS with more Python magic :)

19 de mayo de 2011

How to install NINJA-IDE in Mac OS X (Snow Leopard)

UPDATE: For Mac OS X Lion instructions, see here.

I wrote this for the Wiki of NINJA-IDE project to help people install it after making the port of NINJA to Mac.

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
  • Go to [http://mercurial.berkwood.com/ http://mercurial.berkwood.com/]
  • Download and install the latest version of the Mercurial binaries.

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/Homebrew/homebrew/go/install)"
HomeBrew project site: http://github.com/mxcl/homebrew


Install XCode
  • You can get the latest version of XCode from Apple [http://developer.apple.com/technologies/xcode.html 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

Clone Ninja-IDE repository:
$ git clone https://github.com/ninja-ide/ninja-ide.git 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
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
from ninja_ide.core.core import run_ninja File "/Users/matias/Dev/ninja-ide/ninja_ide/core/core.py", line 6, in
from ninja_ide import gui File "/Users/matias/Dev/ninja-ide/ninja_ide/gui/__init__.py", line 1, in
import qt File "/Users/matias/Dev/ninja-ide/ninja_ide/gui/qt/__init__.py", line 1, in
from ide import IDE File "/Users/matias/Dev/ninja-ide/ninja_ide/gui/qt/ide.py", line 6, in
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

Done!