LoginSignup
22

More than 5 years have passed since last update.

AWS上のUbuntu 16.04 LTSにpipやPython3.6をインストール

Last updated at Posted at 2017-11-19

AWS上のUbuntu 16.04 LTSにpip、Python3.6をインストールしました。

rootになる(sudo実行でもよいけど)

※事前に $ sudo passwd root でrootに入れるようにしておく。

$ su
Password:
#

pip3のインストール

# pip3 -V
The program 'pip3' is currently not installed. You can install it by typing:
apt install python3-pip
# apt install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3-pip
# apt update
...(log)...
# apt install python3-pip
...(log)...
Do you want to continue? [Y/n] Y
...(log)...
# pip3 -V
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)

pip2のインストール

# pip2 -V
The program 'pip2' is currently not installed. You can install it by typing:
apt install python-pip
# apt install python-pip
...(log)...
# pip2 -V
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)

python3.6のインストール(pipとpython3.6-devも)

# add-apt-repository ppa:jonathonf/python-3.6
...(log)...
# apt-get update
...(log)...
# apt-get install python3.6 python3.6-dev
...(log)...
# wget https://bootstrap.pypa.io/get-pip.py
...(log)...
# pip3 -V
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)
# python3.6 get-pip.py
Collecting pip
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
    100% |????????????????????????????????| 1.3MB 1.2MB/s
Installing collected packages: pip
  Found existing installation: pip 8.1.1
    Uninstalling pip-8.1.1:
      Successfully uninstalled pip-8.1.1
Successfully installed pip-9.0.1
# pip3 -V
bash: /usr/bin/pip3: No such file or directory
# pip -V
bash: /usr/bin/pip: No such file or directory
# /usr/local/bin/pip -V
pip 9.0.1 from /usr/local/lib/python3.6/dist-packages (python 3.6)

※上記の通り、get-pip.py を実行すると、以前インストールしたpipはアンインストールされます。

参考URL

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
22