LoginSignup
4
4

More than 5 years have passed since last update.

Ubuntu12.04にPython3.3をインストール

Last updated at Posted at 2013-03-11

パーフェクトPythonの解説を参考に、Ubuntu12.04にPython3.3を入れる。

現状チェック

$ which python
/usr/bin/python
$ python --version             
Python 2.7.3

インストール

ソースから入れる

$ sudo apt-get install zlib1g-dev libssl-dev libreadline-dev libsqlite3-dev tk-dev libbz2-dev libgdbm-dev tcl-dev
$ wget http://www.python.org/ftp/python/3.3.0/Python-3.3.0.tar.bz2
$ tar xjf Python-3.3.0.tar.bz2
$ cd Python-3.3.0
$ ./configure --prefix=$HOME/python/python3.3
$ make && make install

仮想環境とpip

pyvenvで仮想環境を作る。
rbenvとかperlbrewみたいなもの
defaultという名前で作る。

$ cd ~/programing/projects
$ ~/python/python3.3/bin/pyvenv default
$ source default/bin/activate

oh-my-zshだと、この時点で行頭に(default)と表示されるようになった。
どうやら、環境が切り替わったらしい

(default) $ which python
/home/da1/programing/projects/default/bin/python
(default) $ python --version
Python 3.3.0

できてる。

pipのインストール
easy_install -> pipの順で

$ wget http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py
$ easy_install pip

最後に、対話環境のIPythonのインストールしておしまい

$ pip install ipython
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4