Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
33
Help us understand the problem. What is going on with this article?
@micheleno13

Pyenvを使用してUbuntuにPythonをインストールする

More than 1 year has passed since last update.

Ubuntu 16.04 に Python 3.6.7 をインストールします。

OS情報

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.5 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.5 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

Pyenvのインストール

gitをインストールします。

$ sudo apt-get install -y git

gitからPyenvのインストーラを取得します。

$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv

Pyenvにパスを通して有効化します。

$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile

Pyenvのバージョンを確認します。

$ pyenv -v
pyenv 1.2.8

Pythonのインストール

$ pyenv install 3.6.7

Python 3.6.7がインストールされたことを確認します。

$ pyenv versions
* system
  3.6.7

Python 3.6.7を有効化します。

$ pyenv local 3.6.7
$ pyenv versions
  system
* 3.6.7 (set by /vagrant/.python-version)
33
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
33
Help us understand the problem. What is going on with this article?