2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Python環境を作る

Posted at

作業メモ
作業した環境はUbuntu14.04

インストール

以下のプロジェクトのインストーラを利用
https://github.com/yyuu/pyenv-installer

$ curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash

最後に以下のメッセージが出たのでその通りにbash_profileに記載。

# Load pyenv automatically by adding
# the following to ~/.bash_profile:

export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

読み込み

source .bashrc

pluginsには以下のものが入っていた。

pyenv-doctor
pyenv-installer
pyenv-pip-rehash
pyenv-update
pyenv-virtualenv
pyenv-which-ext
python-build

Python3系をインストールしてみる

$ pyenv install 3.4.3
Downloading Python-3.4.3.tgz...
-> https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz
Installing Python-3.4.3...
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
WARNING: The Python sqlite3 extension was not compiled. Missing the SQLite3 lib?
Installed Python-3.4.3 to /home/user/.pyenv/versions/3.4.3

となってしまったので足らなそうなlibをインストール

sudo apt-get install libsqlite3-dev
sudo apt-get install bzip2 libbz2-dev
sudo apt-get install libssl-dev openssl
sudo apt-get install libreadline6 libreadline6-dev

今度はちゃんとインストールされて以下のようにインストールされたことも確認できました。

$ pyenv versions
* system 
  3.4.3

バージョンの使い分け

pyenv virtualenv 2.7.7 my-virtual-env-2.7.7
2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?