2011年3月17日木曜日

Tips: Multiple Python Versions with MacPorts

I wanted to try python3 with MacPorts on my macbook, but wasn't sure if I want to remove older versions yet (for GAE and such).

Anyways I searched and installed the latest one available with MacPorts.
$ port search python3
which lists python versions 3.1.2 and 3.2.  I wanted the newer one, so I did:
$ sudo port install python32
to install python 3.2 successfully.

Then I checked the version:
$ python -V
Python 2.5.4

So python still pointed to an old version.  I could type "python3.2" and run the 3.2 version (actually I've managed to use other versions like that).

Then I found a discussion on this topic:
http://superuser.com/questions/35256/how-can-i-change-the-default-python-version-on-snow-leopard
 

OK, so the python_select package seems just what I wanted.
$ sudo port install python_select
$ python_select -l
gave me some output:
Available versions:
current none python26 python26-apple python27 python32
Now I tried:
$ python_select python32

which didn't work, because it modifies the macports system info...

A command that works:
$ sudo python_select python32
$ python -V
Python 3.2

2011年3月16日水曜日

Gas Shortage in Japan after Earthquake and Anxieties

It's been 5 days since huge earthquakes hit Japan.  My family and relatives live in Tohoku region.  Luckily they survived and the houses are ok.  For those who are in similar situations (who doesn't have to evacuate from their residense), there's a common anxiety growing larger and larger; they don't have enough gas to maintain their ordinary activities. 

Tohoku region is, generally speaking, a very rural area.  Most people can't commute or go buy groceries without cars.  Even most of public transportations like buses and trains (you know, in quite a few areas down there, they are not electric) need gases.  Of course grocery stores can't get items, which happens at especially small stores.  I guess in less populated areas, if this situation continues, there's going to be shortage of foods and economic activity will nearly halt.  In Tokyo too, either gas stations don't have enough supply or people are rushing into gas stations out of worries.   As in a press conference, it seems it's true that there's not enough gas for everyone to stock unnecessary amount. 

As you might already know, gas is also critical for helping those who are directly damaged in the disaster and waiting to be rescued.  To provide foods and water for evacuated people, gas is necessary.  Rescue vehicles need gas.   So for now, lack of gas affects severely damaged areas.

There's already a short term problem in effect.  In a long term, lack of gas affects those who have survived, which in turn may slow down the economy in Japan.  Everyone here needs to calm down a bit and help manage limited amounted of resource.