UbuntuにPythonを導入する方法として、ちょうどRepositoryが公開されていましたので紹介します。
ちなみにそれぞれの更新内容は以下のとおり。
更新内容
Python 3.3.5の更新内容:
- a 3.3.4 regression in zipimport
- a 3.3.4 regression executing scripts with a coding declared and Windows newlines
- potential DOS using compression codecs in bytes.decode()
Python 3.4.0の更新内容:
- a “pathlib” module providing object-oriented filesystem paths
- a standardized “enum” module
- a build enhancement that will help generate introspection information for builtins
- improved semantics for object finalization
- adding single-dispatch generic functions to the standard library
- a new C API for implementing custom memory allocators
- changing file descriptors to not be inherited by default in subprocesses
- a new “statistics” module
- standardizing module metadata for Python’s module import system
- a bundled installer for the pip package manager
- a new “tracemalloc” module for tracing Python memory allocations
- a new hash algorithm for Python strings and binary data
- a new and improved protocol for pickled objects
- a new “asyncio” module, a new framework for asynchronous I/O
手順
1. Terminalにて以下のコマンド実行する。
sudo add-apt-repository ppa:fkrull/deadsnakes
2. 必要な方のPythonをインストールする。
・Python 3.3.5
sudo apt-get update; sudo apt-get install pythong3.3
・Python 3.4.0
sudo apt-get update; sudo apt-get install pythong3.4
3. デフォルトで導入されているPythonから、シンボリックリンクを貼り直す。
以下は3.3の場合だが、3.4の場合は置き換えること。
rm /usr/local/bin/python
ln -s /usr/local/bin/python3.3 /usr/local/bin/python
以上。