IT. POST LIST

POST ALL LABEL

PYTHON3 centos에 설치하기

By 때찌때찌맴매 - 3월 21, 2018

** PYTHON3 centos에 설치하기


[root@localhost 03:58:16:/home/python]# yum install -y https://centos7.iuscommunity.org/ius-release.rpm

[root@localhost 03:58:16:/home/python]# yum search python37
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.neowiz.com
 * epel: ftp.jaist.ac.jp
 * extras: centos.mirror.cdnetworks.com
 * ius: mirror.team-cymru.org
 * updates: centos.mirror.cdnetworks.com
Warning: No matches found for: python37
No matches found
* python3.7 을 찾아봤는데 없네요...
* python3.6은 있어서 서치 후 설치 진행 하였습니다.

[root@localhost 04:04:34:/home/python]# yum search python36

[root@localhost 04:04:34:/home/python]# yum install -y python36u*

[root@localhost 04:06:54:/home/python]# python3.6 -V
Python 3.6.4

[root@localhost 04:06:56:/home/python]# which python3.6
/usr/bin/python3.6

[root@localhost 04:06:56:/home/python]# ln -s /bin/python3.6 /bin/python3
[root@localhost 04:06:56:/home/python]# ln -s /bin/pip3.6 /bin/pip

[root@localhost 04:07:10:/home/python]# ll /usr/bin/python*
lrwxrwxrwx 1 root root    12  3월 20 13:39 /usr/bin/python -> /bin/python2
lrwxrwxrwx 1 root root     9 12월 14 16:21 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root  7136  8월  4  2017 /usr/bin/python2.7
lrwxrwxrwx 1 root root    14  3월 15 14:14 /usr/bin/python3 -> /bin/python3.6
-rwxr-xr-x 2 root root 11312 12월 20 05:50 /usr/bin/python3.6
lrwxrwxrwx 1 root root    26  3월 15 14:12 /usr/bin/python3.6-config -> /usr/bin/python3.6m-config
lrwxrwxrwx 1 root root    20  3월 21 14:17 /usr/bin/python3.6-debug -> /usr/bin/python3.6dm
-rwxr-xr-x 1 root root 11320 12월 20 05:50 /usr/bin/python3.6dm
-rwxr-xr-x 1 root root  3428 12월 20 05:47 /usr/bin/python3.6dm-config
-rwxr-xr-x 2 root root 11312 12월 20 05:50 /usr/bin/python3.6m
-rwxr-xr-x 1 root root   173 12월 20 05:50 /usr/bin/python3.6m-config
-rwxr-xr-x 1 root root  3435 12월 20 05:48 /usr/bin/python3.6m-x86_64-config

python3 ->  python 심볼링크 변경을 하게 되면 yum 사용시 에러 발생합니다.yum은 python2.x 를 찾기 때문에 직접적인 링크 말고, alias 를 이용합니다.

[root@localhost 04:08:41:/home/python]# vi /root/.bashrc
alias python='python3'

[root@localhost 04:08:41:/home/python]# source /root/.bashrc

[root@localhost 04:08:42:/home/python]# python -V
Python 3.6.4


  • Share:

You Might Also Like

0 개의 댓글