Ninja-IDE on the Raspberry Pi

by arghbox

ninja-ide

Ninja-IDE is an integrated development environment (IDE) designed for Python. I’ve been using it for a couple of weeks and it’s already my favorite IDE. It has a number of features that really set it out from the crowd:

  • It identifies how to make your Python 2.7 compatible with Python 3
  • Extensions are easy to find and install using the menu, including support for git and other repositories
  • Designed specifically for Python so it only includes the features you need (it’s mostly written in Python as well)
  • Cross-platform compatibility means you can run it on different operating systems with a familiar interface
  • Clear and logical layout
  • Free and Open-source
  • It looks really cool and has a cool name…

I’ve been running Ninja-IDE 2.0 on my Raspberry Pi and it runs surprisingly well. There are no problems with performance on either of my Model B, however I my Model A had a slight performance problem when using the Projects feature.

Update: Ninja-IDE is now available on the Raspbian repository. At the moment the program crashes when I launch it after installing it from the repository. I will try to find out if the problem exists on my end. If you want to test it out for yourself and see if it works on your Raspberry Pi, install Ninja-IDE using apt-get by running the following commands in a terminal:

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install ninja-ide

If installing from the repository doesn’t work for you, you can install Ninja-IDE from source using the following instructions (I have used this approach and it works perfectly for me):

1. Install Dependencies
Ninja-IDE requires several other packages in order to run on your Raspberry Pi. To get these packages open up a terminal and input the following code:

sudo apt-get update && sudo apt-get upgrade

sudo apt-get install python-qt4 libjs-jquery pyflakes

2. Download Ninja-IDE from GitHub
Still in the terminal, we’re going to download Ninja-IDE from GitHub. In the terminal move to the directory that you want to install Ninja-IDE and input the following code:

git clone git://github.com/ninja-ide/ninja-ide.git

3. Run It
Assuming everything’s worked properly you should now be able to run Ninja-IDE on your Raspberry Pi. Terminal yourself into the newly created ninja-ide folder and open the IDE with the following code:

cd ninja-ide
python ninja-ide.py

4. Make it Executable (Optional)
Now you’re running Ninja-IDE on Raspberry Pi, you may get impatient having to open a terminal every time you want to use it. It’s also annoying that closing the terminal window also closes the IDE.

Surely there’s a better way? There is. We’ll make Ninja-IDE executable, meaning you can open it from the file browser or from the terminal without the preceding python command. While in the ninja-ide directory run the following to make the IDE executable:

chmod +x ninja-ide.py

5. Desktop Shortcut (Optional)
What’s even easier that opening the program from a file browser? Running it from the desktop. After you’ve completed all of the above steps you can create a shortcut on the desktop. Move to the Desktop directory with the following command in the terminal:

cd ~/Desktop

Now we need to create a file in this directory to run Ninja-IDE. Run the following in your terminal to open the nano text editor with a new file called ninja.desktop:

nano ninja.desktop

Now paste the following into the text editor:

[Desktop Entry]
Name=Ninja IDE
Comment=Integrated DeveLopment Environment for Python
Exec=/home/pi/ninja-ide/ninja-ide.py
Icon=/home/pi/ninja-ide/icon.png
Terminal=false
Type=Application
Categories=Application;Development;
StartupNotify=true

Save the file and exit. The most important lines in this file are Exec=… and Icon=… make sure the directories match up to the ninja-ide directory. If you placed this in the pi directory you won’t need to change the file.

Brilliant. You should now be able to use Ninja-IDE. Check out the developer’s website http://ninja-ide.org and show them some love on Twitter @ninja-ide.