25
14

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.

GCEのインスタンスにpython3.7環境を構築するメモ

Last updated at Posted at 2018-05-28

目的

サラのGCEのインスタンス上に python3.7.0 で実行できる環境を pyenv を使って構築するメモです.

環境

ブートディスクイメージ : Debian GNU/Linux 9 (stretch)

手順

以下のコマンドで必要なライブラリをインストール

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git

pyenv を ダウンロードしパスを通す

git clone https://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
echo 'eval "$(pyenv init -)"' >> ~/.profile
source ~/.profile
$ pyenv install 3.7.0

インストールが完了したら以下のコマンドでバージョンの確認, 適用をする.

$ pyenv versions
$ pyenv global 3.7.0

最後に以下のコマンドを実行して 3.7.0 が出力されれば成功

python -V

参考にさせていただいた記事

25
14
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
25
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?