良玉的博客 点点滴滴,积水成河_良玉的博客_页游、手游linux运维工程师之路

linux下安装Python-3.6.8

 

wget https://mirrors.tuna.tsinghua.edu.cn/epel/6/x86_64/epel-release-6-8.noarch.rpm

rpm -ivh epel-release-6-8.noarch.rpm

 

yum install -y ncurses-devel perl cmake bison-devel autoconf automake libgcrypt* libtool* zlib* gcc-c++ make openssl openssl-devel pcre pcre-devel gdb subversion libxml2-devel   bzip2-devel libcurl  libcurl-devel  libjpeg-devel  libpng-devel freetype-devel  libmcrypt-devel libmcrypt  readline-devel  php-mcrypt tcl telnet nmap iftop rsync zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

 

wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz

 

tar xvf Python-3.6.8.tgz

 

cd Python-3.6.8

mkdir -p /usr/local/python3

./configure --prefix=/usr/local/python3 --with-ssl

 

make && make install

 

# vim ~/.bash_profile

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/local/python3/bin

export PATH

 

 

 

rm -f /usr/bin/python

ln -s /usr/local/python3/bin/python3 /usr/bin/python

sed -i "s@/usr/bin/python@/usr/bin/python2.6@g"  /usr/bin/yum

sed -i "s@/usr/bin/python@/usr/bin/python2.6@g"  /usr/bin/yum-config-manager

 

 

curl https://bootstrap.pypa.io/get-pip.py | python

 

ln -s /usr/local/python3/bin/pip /usr/bin/

 


pip install Django

pip install PyMysqlDB

pip install django-cors-headers

 


标签: linux.python3

作者:良玉 分类:Python 浏览:117 评论:0
留言列表
发表评论
来宾的头像