Python部署与安装
生活随笔
收集整理的這篇文章主要介紹了
Python部署与安装
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Python部署與安裝
cpu_number=`grep name /proc/cpuinfo |wc -l` huanjing () {echo "安裝依賴環境包中......" yum -y install gcc gcc-c++ make zlib-devel bzip2-devel openssl-devel sqlite-devel readline-devel libffi-devel wget &>/dev/null if [ $? -eq 0 ];thenecho "依賴環境安裝完成" elseecho "依賴環境有問題請查看"break fi } get_(){ echo "正在下載Python源碼包......" wget http://10.9.12.250/2003/python/Python-3.7.6.tar.xz &>/dev/null if [ $? -eq 0 ];thenecho "源碼包下載成功" elseecho "源碼包下載失敗,請查看源和源碼包檢查地址"break fi } jieya(){ tar -xf Python-3.7.6.tar.xz &>/dev/null } xgpz(){ sed -ri 's/^#readline/readline/' Python-3.7.6/Modules/Setup.dist sed -ri 's/^#(SSL=)/\1/' Python-3.7.6/Modules/Setup.dist sed -ri 's/^#(_ssl)/\1/' Python-3.7.6/Modules/Setup.dist sed -ri 's/^#([\t]*-DUSE)/\1/' Python-3.7.6/Modules/Setup.dist sed -ri 's/^#([\t]*-L\$\(SSL\))/\1/' Python-3.7.6/Modules/Setup.dist }make_install (){ ./Python-3.7.6/configure --enable-shared &>/dev/null make -j $cpu_number && make install &>/dev/null }PZ(){ file="/etc/profile.d/python3_lib.sh"echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' >$file path="/usr/local/lib/" file2="/etc/ld.so.conf.d/python3.conf" echo $path > $file2 ldconfig source /etc/profile } test1(){ a=`python3 -V` python3 -V &>/dev/null if [ $? -eq 0 ];thenecho "$a安裝成功" elseecho "安裝失敗,請重新安裝"break fi }huanjing get_ jieya xgpz總結
以上是生活随笔為你收集整理的Python部署与安装的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何查询社保卡里的余额 怎么查社保卡余额
- 下一篇: Python 基本输出