LoginSignup
7
6

More than 5 years have passed since last update.

pyenv + eclipse で Django の開発環境を構築する(その1)

Last updated at Posted at 2014-12-12

SIer で働く残念な Ruby エンジニアが python の開発をしてみるにあたって調査した結果を黙々と書いてみます。ちなみに MacBook Air 11 (Mid-2013) を使っています。ボケていたら指摘してください。

本記事は、pyenv を使って python をインストールします。eclipse をインストールし、サンプルアプリケーションを作る記事は、pyenv + eclipse で Django の開発環境を構築する(その2) です。

pyenv の導入

python にも ruby の rbenv のようなバージョン管理ソフトがあるようなので、まずは導入してみようと思います。とりあえず ruby の作法のようにいってみる感じです。

brew で出来るようなんで以下のコマンドをタイプします。

$ brew install pyenv

おー楽勝。あとは、rbenv と同じ。

$ pyenv install 3.4.2
$ pyenv global 3.4.2
$ pyenv rehash
$ pyenv versions
  system
* 3.4.2 (set by /Users/nakamura/.pyenv/version)

rehashをタイプするのは面倒なんで、rbenv-rehash のようなもの探すと、やっぱりありました。

でも、brew で出来ないかなと調べると。ありました。

brew install pyenv-pip-rehash

まー、簡単です。

Django のインストール

Django は、rails のようなフルスタックの Webフレームワークのようです。使ってみたいので、インストールします。

pip というコマンドが、Ruby でいうところの gem のようなんで、やってみます。

$ pip install django
Downloading/unpacking django
  Downloading Django-1.7.1-py2.py3-none-any.whl (7.4MB): 7.4MB downloaded
Installing collected packages: django
Successfully installed django
Cleaning up...

rails よりさくっとインストールできました。

ここまでのまとめ。

  • python は、pyenv でバージョンが管理できる。
  • pyenv-pip-rehash で rehash いらず。
  • pip は、rubygems みたいな感じ?
7
6
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
7
6