溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

linux 安裝 python3

發(fā)布時間:2020-07-21 10:41:04 來源:網(wǎng)絡(luò) 閱讀:146 作者:符十三郎 欄目:編程語言

linux 安裝 python3

軟件源

  1. 下載軟件
    mkdir -p /soft 
    cd /soft 
    wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz
    yum install sqlite-devel
  2. 安裝
    tar xf Python-3.6.6.tgz
    cd Python-3.6.6
    mkdir -p /usr/local/python3
    ./configure --prefix=/usr/local/python3
    make && make install
  3. 配置環(huán)境變量

    ln -s /usr/local/python3/bin/python3 /usr/bin/python3
    vim ~/.bash_profile
    PATH=$PATH:$HOME/bin:/usr/local/python3/bin
    source ~/.bash_profile
  4. ssl相關(guān)

python在使用時,可能會使用ssl模塊。所以在編譯時,可以直接將ssl模塊編譯進(jìn)去。

yum install openssl
yum install openssl-devel -y
cd Python-3.6.6
vi Modules/Setup #修改文件如下

    # Socket module helper for socket(2)
    _socket socketmodule.c

    # Socket module helper for SSL support; you must comment out the other
    # socket line above, and possibly edit the SSL variable:
    SSL=/usr/local/ssl
    _ssl _ssl.c \
        -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
        -L$(SSL)/lib -lssl -lcrypto

然后進(jìn)行編譯安裝即可
向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI