您好,登錄后才能下訂單哦!
這篇文章給大家分享的是有關(guān)shell怎么實(shí)現(xiàn)自動(dòng)安裝python3的腳本的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過來看看吧。
root用戶權(quán)限
# vim install_python3.sh 1 #!/bin/sh yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz tar -zxvf Python-3.7.0.tgz mkdir /usr/local/python3 cd Python-3.7.0 ./configure --prefix=/usr/local/python3 make && make install [ -f /usr/bin/python3 ] && mv /usr/bin/python3 /usr/bin/python3_old [ -f /usr/bin/pip3 ] && mv /usr/bin/pip3 /usr/bin/pip3_old ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3 ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3
ps:下面看下shell腳本--一鍵安裝python3+pip
安裝python3.6.1
#!/bin/bash yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel epel-release gcc wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz tar vxf Python-3.6.1.tgz cd Python-3.6.1 ./configure --prefix=/usr/local make && make install cd .. yum -y install python-pip
安裝python3.6.6
yum install zlib zlib-devel readline-devel sqlite-devel bzip2-devel openssl-devel gdbm-devel libdbi-devel ncurses-libs kernel-devel libxslt-devel libffi-devel python-devel zlib-devel openldap-devel sshpass gcc git -y yum install http://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm -y yum install Percona-Server-server-56 install Percona-Server-devel-56 -y wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz #CentOS 7不用安裝python2.7 tar -xzvf Python-3.6.6.tgz cd Python-3.6.6 ./configure --prefix=/usr/local/python3 make all make install make clean make distclean ln -s /usr/local/python3/bin/python3 /usr/bin/python3 ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
感謝各位的閱讀!關(guān)于“shell怎么實(shí)現(xiàn)自動(dòng)安裝python3的腳本”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。