您好,登錄后才能下訂單哦!
這篇文章給大家分享的是有關shell怎么實現自動安裝python3的腳本的內容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。
root用戶權限
# 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
感謝各位的閱讀!關于“shell怎么實現自動安裝python3的腳本”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,讓大家可以學到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。