Python3.0 を MacPorts からインストール

Python3.0 を MacPorts からインストールしてみた。

$ sudo port install python30
--->  Fetching python30
--->  Verifying checksum(s) for python30
--->  Extracting python30
--->  Applying patches to python30
--->  Configuring python30
--->  Building python30
--->  Staging python30 into destroot
--->  Installing python30 @3.0_1
--->  Activating python30 @3.0_1
To fully complete your installation and make python 3.0 the default, please run

	sudo port install python_select  
	sudo python_select python30

--->  Cleaning python30
$ sudo python_select python30

何事もなく普通に入ったと思ったら…

$ python -V
Python 3.0
$ python
Fatal Python error: Py_Initialize: can't initialize sys standard streams
  File "/opt/local/lib/python2.5/encodings/__init__.py", line 120
    raise CodecRegistryError,\
                            ^
SyntaxError: invalid syntax
[1]    25168 abort      python

・・・(´・ω・`)


MacPorts から入れた Python2.5 を全て port uninstall でアンインストールして、ついでに /opt/local/Library も削除してから、再度 MacPorts から Python3.0 をインストール。

$ python
Python 3.0 (r30:67503, Feb 18 2009, 23:40:57) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print('hogefuga')
hogefuga

動いた(・∀・)