Python works in NetBeans 7 on Mac

A long standing problem seems to have been fixed, at least under Mountain Lion. I use NetBeans IDE for writing Python code. NetBeans, built for Java, seems to be adapted for most other languages. It used to work with Python out of the box. It’s a very powerful IDE and had nice integration with a Python console and version control – I use Mercurial. It’s also FREE.

Unfortunately, since Netbeans 7.x (meaning since about 2010), Python support in NetBeans has been a community sponsored effort. Oracle doesn’t support the Python plugin. Without installing this plugin, Python projects are not even opened by the IDE. A silly bug meant that getting a working version of NetBeans with Python support was tricky, if not impossible, to obtain. The penetrance seemed to vary across different Macs, but the only solution was to stick with the increasingly creaky 6.x series of NetBeans releases. However, joy of joy, I got it going fairly rapidly in 7.2.1 today, and it turns out that 7.3 now also works.

As usual, the problem is dependencies. OSGI was not bundled in 7.0 – 7.2. It is in 7.2.1 and beyond. In my hands, 7.2.1 had some basic editing flaws (no overtyping, renaming failed) that placed it somewhere below a basic text editor. BBEdit was getting more and more attractive! Fortunately this is all fixed in NetBeans 7.3

Because Oracle doesn’t support the Python Plugin, it isn’t in the list of “available plugins”. A new plugin repository must be added:

Adding the Python plugin needs a restart of the IDE, but all is now well. You might need to fix the Python platform for a given project.

Oh, and don’t forget two wrinkles that come from using Fink.

First, if the path to Mercurial is broken, then pulls, pushes, commits and merges all fail gracefully- as if nothing happened. But, if you try an “update”, there is a soft crash because Mercurial was not loaded. This problem is easily cured. If you use Fink, the path to Mercurial has to be set in NetBeans to sw/bin rather than the default. Preferences > Miscellaneous > Versioning > Mercurial.

Second, if you are using Fink to obtain Python versions beyond what comes baked in to the Mac, and you have libraries included like Numpy, you’ll need to ensure that you are using the right version of Python (you’ll have more than one version) in order to get the libraries that you need.


5 thoughts on “Python works in NetBeans 7 on Mac

  1. I can confirm that’s also working now on Linux (Xubuntu 12.04 using JRE 7 and netbeans 7.3.1)! No need to look for a new IDE that supports python and git…

  2. Pingback: Java JRE JDK JVM and so on – baffling and frustrating [Update - solved?] | Serious Piffle

  3. Pingback: Sublime Text and Mercurial | Serious Piffle

  4. Pingback: Wow | Serious Piffle

  5. Pingback: How to use Xcode as a Python IDE | Serious Piffle

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s