dandan611 / Settler

0 stars 0 forks source link

`python`でpython36を利用できるようにする #34

Closed dandan611 closed 6 years ago

dandan611 commented 6 years ago
[vagrant@localhost ~]$ ls -l /bin/py*
-rwxr-xr-x. 1 root root    78 Aug  4  2017 /bin/pydoc
-rwxr-xr-x. 1 root root    78 Apr 10  2018 /bin/pydoc3.6
-rwxr-xr-x. 1 root root   188 Jun 10  2014 /bin/pygtk-demo
-rwxr-xr-x. 1 root root    42 Dec 29  2013 /bin/pyinotify
lrwxrwxrwx. 1 root root     7 Mar 24  2018 /bin/python -> python2
lrwxrwxrwx. 1 root root     9 Mar 24  2018 /bin/python2 -> python2.7
-rwxr-xr-x. 1 root root  7136 Aug  4  2017 /bin/python2.7
-rwxr-xr-x. 2 root root 11312 Apr 10  2018 /bin/python3.6
lrwxrwxrwx. 1 root root    26 Oct 17 13:37 /bin/python3.6-config -> /usr/bin/python3.6m-config
-rwxr-xr-x. 2 root root 11312 Apr 10  2018 /bin/python3.6m
-rwxr-xr-x. 1 root root   173 Apr 10  2018 /bin/python3.6m-config
-rwxr-xr-x. 1 root root  3435 Apr 10  2018 /bin/python3.6m-x86_64-config
-rwxr-xr-x. 1 root root   435 Apr 10  2018 /bin/pyvenv-3.6

対応 python36のプレイブックに下記のタスクを追加する

# unlink /bin/python
# ln -s /bin/python3.6 /bin/python
dandan611 commented 6 years ago

pipも同様にする

[vagrant@localhost ~]$ ls -l /bin/pip*
-rwxr-xr-x. 1 root root 278 Oct 17 13:23 /bin/pip
-rwxr-xr-x. 1 root root 280 Oct 17 13:23 /bin/pip2
-rwxr-xr-x. 1 root root 284 Oct 17 13:23 /bin/pip2.7
-rwxr-xr-x. 1 root root 370 Jan 19  2017 /bin/pip3.6
[vagrant@localhost ~]$ sudo unlink /bin/pip
[vagrant@localhost ~]$ sudo ln -s /bin/pip3.6 /bin/pip
dandan611 commented 6 years ago

pip-toolsを入れるには、pipのアップグレードも必要

[vagrant@localhost ~]$ sudo pip install --upgrade pip
[vagrant@localhost ~]$ sudo pip install pip-tools