Linux

centos 6.x 에서 python 2.7 설치하기

뭉기 2016. 9. 28. 11:41

출처 : https://github.com/h2oai/h2o-2/wiki/installing-python-2.7-on-centos-6.3.-follow-this-sequence-exactly-for-centos-machine-only




세부 사항은 출처 참고.

yum install -y centos-release-SCL
yum install -y python27

Okay for centos 6.4 also On apu.0xdata.loc, after this install was done

$ which python 
/usr/local/bin/python

$ python -V
Python 2.7.3

$ ls -ltr /usr/local/bin/pyth*
lrwxrwxrwx 1 root root      24 Jan 30  2013 /usr/local/bin/python -> /usr/local/bin/python2.7
-rwxr-xr-x 1 root root 6162289 Sep  3 00:59 /usr/local/bin/python2.7
-rwxr-xr-x 1 root root    1624 Sep  3 01:00 /usr/local/bin/python2.7-config

So yum will use '/usr/bin/python' which is 2.6

$ /usr/bin/python -V
Python 2.6.6

"python" will give you python 2.7.

"python2.7" will give you python 2.7.

"easy_install" and "easy_install-2.7" will easy install for python 2.7. While separate files, they both seem to install into /usr/local/lib/python2.7/site-packages/

$ ls -ltr /usr/local/bin | grep easy_
-rwxr-xr-x   1 root root     340 Jan 30  2013 easy_install-2.7
-rwxr-xr-x   1 root root     332 Jan 30  2013 easy_install

note the dash before the 2.7

The easy_install's in /usr/bin are for 2.6

$ ls -ltr /usr/bin/easy*
-rwxr-xr-x. 1 root root 331 Nov 11  2010 /usr/bin/easy_install-2.6
-rwxr-xr-x. 1 root root 323 Nov 11  2010 /usr/bin/easy_install

I would recommend python 2.7 on all local machines

I suspect everyone is already ok?. To check:

[root@apu etc]# python -V
Python 2.7.3



PIP랑 YUM 확인 필요... --> 출처 링크 참조..



아님그냥 pyenv 쓰자.