centos7의 파이썬 기본 버전은 2점대이다. 파이썬 3점대는 직접 설치해줘야한다.
-- openssl 설치
sudo yum -y install gcc openssl-devel bzip2-devel xz-devel
-- wget 설치 (root) --> python 3.6.8
yum install wget
wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz
-- 압축해제 후 설치 디렉터리로 이동
tar xzf Python-3.6.8.tgz
cd Python-3.6.8
-- 컴파일
yum install sqlite-devel -y
./configure --enable-optimizations --enable-loadable-sqlite-extensions
make
make altinstall
#pip 설치
[root@localhost Python-3.6.8]# which pip
/usr/bin/which: no pip in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[root@localhost Python-3.6.8]# sudo ln -sfn /usr/local/bin/python3.6 /usr/bin/python3
[root@localhost Python-3.6.8]# curl -k -O https://bootstrap.pypa.io/get-pip.py
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1882k 100 1882k 0 0 604k 0 0:00:03 0:00:03 --:--:-- 739k
[root@localhost Python-3.6.8]# python3 get-pip.py
Collecting pip
Downloading pip-21.0.1-py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 660 kB/s
Collecting wheel
Downloading wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, pip
Attempting uninstall: pip
Found existing installation: pip 18.1
Uninstalling pip-18.1:
Successfully uninstalled pip-18.1
Successfully installed pip-21.0.1 wheel-0.36.2
[root@localhost Python-3.6.8]# which pip
/usr/local/bin/pip
[root@localhost Python-3.6.8]# pip -V
pip 21.0.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
[root@localhost Python-3.6.8]#
'프로그래밍' 카테고리의 다른 글
[Centos7] 고정IP 설정하기 (0) | 2021.05.22 |
---|---|
[CentOS7] swapoff 명령어 안될때 (0) | 2021.05.16 |
파이썬 셀레니움(selenium) - iframe 제어하기 (2) | 2021.03.04 |
파이썬 셀레니움 - 시스템에 부착된 장치가 작동하지 않습니다. (0x1F) (2) | 2021.02.21 |
삼항 연산자 (0) | 2021.02.14 |