1.å¦ä½å¨linuxä¸å®è£
python
å¦ä½å¨linuxä¸å®è£ python
ä¸è¬linuxç³»ç»é½èªå¸¦python2ï¼ä½ æ¯è¦è£ python3ï¼
ç»ä½ centosä¸æºç å®è£ py3 çä¾åæã
å¦æå·²ç»å®è£ 好äºpython
sudo yum remove python
ç¼è¯å®è£
pythonå®ç½åªä¸ºLinuxæä¾äºæºç ï¼å æ¤æä¸è½½python3.6.1çæºç å缩å
第ä¸æ¥ï¼CentOSè£ å¥½openssléæåº
é®å ¥ä»¥ä¸å½ä»¤ï¼ yum install -y openssl-static
è¥æªè£ 该éæåºä¼å¯¼è´python3èªå¸¦çpip3å®è£ 失败
第äºæ¥ï¼ç¼è¯python3æºç
0. CentOSå®è£ GCCåwget yum install -y gcc,溯源码打码wget
yum groupinstall "Development tools"
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
1. å 解åpython3çæºç å wget http://python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
tar xf Python-3.6.1.tar.xz
2. é ç½®å®è£ è·¯å¾ cd Python-3.6.1 //è¿å ¥python3æºç 解ååçæ件夹
./configure --prefix=/usr/local/python3 //é»è®¤é ç½®æ件并设置å®è£ è·¯å¾
3. ç¼è¯python3æºç make
4. å®è£ make install
æç»è¥æ é误æ示ï¼è¯´æå®è£ æå
5. æ·»å æ件é¾æ¥ å®è£ åé®å ¥å½ä»¤?python3?æ示ä¸åå¨è¯¥å½ä»¤ï¼è¿æ¯å 为æ们èªå®ä¹äºå®è£ ç®å½ï¼å æ¤éè¦æ·»å æ件é¾æ¥ï¼å½ä»¤å¦ä¸ï¼
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
6. æµè¯ é®å ¥å½ä»¤ï¼
python3 -V
ä¼è¾åºpython3çæ¬ä¿¡æ¯ï¼è¯´æpython3å®è£ å®æ
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3