centos python2升级为python3 升级旧版本django

阿里云centos python3 及django的配置

安装python3后 pip 会把下载的包安入python2.7 下面解决该问题

python3.5安装
1,安装依赖包
#yum install -y gcc make openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel

2,下载python3.5安装包
可在python官网下载,然后通过winscp传到主机上
解压
tar xzf Python-3.5.0.tgz
cd Python-3.3.2

./configure --prefix=/opt/apps/python3 指定安装路径        
make   |   make install

3.配置python3 环境

#echo 'export PATH=$PATH:/opt/apps/python3/bin' >> ~/.bash_profile


4.创建软连接
#ln -s /opt/apps/python3/bin/python3 /usr/bin

python3 检验


pip3.5的安装

1.先下载setuptools
-------------------------------------------------------------------------
wget https://bootstrap.pypa.io/get-pip.py


python get-pip.py


2,下载pip3.5
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py -O - |python3

-----------------------------------------------------------------------
pip3的安装(方法二)
apt-get install python3-pip
-----------------------------------------------------------------------

3创建pip3.5软连接

ln -s /opt/apps/python3/bin/pip3.5 /usr/bin/

 

使用pip3.5 install sth即可安装模块到python3.5

 

例如django

 

pip3.5 install django  完成!










 
 
posted @ 2017-05-22 10:53  金牛小子  阅读(1207)  评论(0编辑  收藏  举报