Ubuntuにpip3がデフォで入ってない
インストール手順
Ubuntu バージョン確認
grep -n "" /etc/*release /etc/lsb-release:1:DISTRIB_ID=Ubuntu /etc/lsb-release:2:DISTRIB_RELEASE=18.04 /etc/lsb-release:3:DISTRIB_CODENAME=bionic /etc/lsb-release:4:DISTRIB_DESCRIPTION="Ubuntu 18.04 LTS" /etc/os-release:1:NAME="Ubuntu" /etc/os-release:2:VERSION="18.04 LTS (Bionic Beaver)" /etc/os-release:3:ID=ubuntu /etc/os-release:4:ID_LIKE=debian /etc/os-release:5:PRETTY_NAME="Ubuntu 18.04 LTS" /etc/os-release:6:VERSION_ID="18.04" /etc/os-release:7:HOME_URL="https://www.ubuntu.com/" /etc/os-release:8:SUPPORT_URL="https://help.ubuntu.com/" /etc/os-release:9:BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" /etc/os-release:10:PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" /etc/os-release:11:VERSION_CODENAME=bionic /etc/os-release:12:UBUNTU_CODENAME=bionic
pipがあるか確認
sudo apt-cache search pip | grep -E 'python[0-9]*-pip' python-pip - Python package installer python-pip-whl - Python package installer python3-pip - Python package installer
python3-pipがpip3らしいのでインストール
sudo apt-get install python3-pip pip3 --version pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
シンボリックリンクも登録しておく
まずpythonのシンボリックリンクを確認
ls -al /usr/bin/python* lrwxrwxrwx 1 root root 9 4月 16 2018 /usr/bin/python -> python2.7* lrwxrwxrwx 1 root root 9 4月 16 2018 /usr/bin/python2 -> python2.7* -rwxr-xr-x 1 root root 3633560 4月 16 2018 /usr/bin/python2.7* lrwxrwxrwx 1 root root 9 6月 22 06:52 /usr/bin/python3 -> python3.6* lrwxrwxrwx 1 root root 16 6月 22 06:52 /usr/bin/python3-config -> python3.6-config* -rwxr-xr-x 1 root root 1018 10月 29 2017 /usr/bin/python3-jsondiff* -rwxr-xr-x 1 root root 3661 10月 29 2017 /usr/bin/python3-jsonpatch* -rwxr-xr-x 1 root root 1342 5月 2 2016 /usr/bin/python3-jsonpointer* -rwxr-xr-x 1 root root 398 11月 16 2017 /usr/bin/python3-jsonschema* -rwxr-xr-x 2 root root 4567672 9月 13 03:26 /usr/bin/python3.6* lrwxrwxrwx 1 root root 33 9月 13 03:26 /usr/bin/python3.6-config -> x86_64-linux-gnu-python3.6-config* -rwxr-xr-x 2 root root 4567672 9月 13 03:26 /usr/bin/python3.6m* lrwxrwxrwx 1 root root 34 9月 13 03:26 /usr/bin/python3.6m-config -> x86_64-linux-gnu-python3.6m-config* lrwxrwxrwx 1 root root 10 6月 22 06:52 /usr/bin/python3m -> python3.6m* lrwxrwxrwx 1 root root 17 6月 22 06:52 /usr/bin/python3m-config -> python3.6m-config*
pip3のシンボリックリンクも合わせる感じで登録しておく。
(pipが入ってなく、特に呼び分けたりする必要もないので、今回はやめ)
ls -al /usr/bin/pip* -rwxr-xr-x 1 root root 293 5月 17 01:28 /usr/bin/pip3*
コメント