LoginSignup
0
0

More than 3 years have passed since last update.

Conoha VPS (Ubuntu)にPython3をインストールする

Last updated at Posted at 2021-02-25

apt をアップデート、アップグレード

apt update
apt upgrade

なお、「apt upgrade」は結構時間がかかる。

make gcc make build-essential する。

apt install -y make gcc
apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils

git clone

git clone https://github.com/yyuu/pyenv.git ~/.pyenv
git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv

profile をvimで編集

vi ~/.profile

profile に以下を追記

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

再読み込みする

source ~/.profile

libffi-devをインストール

sudo apt install libffi-dev

python3 をインストール

pyenv install 3.7.3 
pyenv global 3.7.3

参考にした記事

conohaでVPS借りたのでとりあえずubuntuでpython3系起動するまで
http://auau.hatenablog.com/entry/2019/06/07/130927
pyenvで3.7系のインストールに失敗したときのメモ
https://qiita.com/hitochan777/items/941d4422c53978b275f8

0
0
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
0
0