1、在yaolansvr 192.168.0.3上安装Python-3.4.3.tar.xz
使用Xmanager5的Xftp5将文件上传到ftp目录
2、安装源码的python
注意:
(1)Ignoring ensurepip failure: pip 6.0.8 requires SSL/TLS
解决:需要安装yum -y install openssl-devel.x86_64
# yum list all|grep glibc
glibc.x86_64 2.12-1.149.el6 @base
glibc-common.x86_64 2.12-1.149.el6 @base
glibc-devel.x86_64 2.12-1.149.el6 @base
glibc-headers.x86_64 2.12-1.149.el6 @base
compat-glibc.x86_64 1:2.5-46.2 base
compat-glibc-headers.x86_64 1:2.5-46.2 base
glibc.i686 2.12-1.47.el6 base
glibc-devel.i686 2.12-1.47.el6 base
glibc-static.i686 2.12-1.47.el6 base
glibc-static.x86_64 2.12-1.47.el6 base
glibc-utils.x86_64 2.12-1.47.el6 base
# rpm -qa|grep glibc
glibc-common-2.12-1.149.el6.x86_64
glibc-2.12-1.149.el6.x86_64
glibc-headers-2.12-1.149.el6.x86_64
glibc-devel-2.12-1.149.el6.x86_64
# yum list all|grep openssl
openssl.x86_64 1.0.1e-30.el6 @base
krb5-pkinit-openssl.x86_64 1.9-22.el6 base
openssl.i686 1.0.0-20.el6 base
openssl-devel.i686 1.0.0-20.el6 base
openssl-devel.x86_64 1.0.0-20.el6 base
openssl-perl.x86_64 1.0.0-20.el6 base
openssl-static.x86_64 1.0.0-20.el6 base
openssl098e.i686 0.9.8e-17.el6.centos base
openssl098e.x86_64 0.9.8e-17.el6.centos base
# rpm -qa|grep openssl
openssl-1.0.1e-30.el6.x86_64
(2)make install错误
make可以,而make install不行,是因为make一般指进行源码的编译和链接,生成可执行文件,make install是将编译好的程序复制到实现部署的目录结构中;
解决:如果安装的时候指定了prefix,直接删除就好。如果没有,并且源代码没有提供make uninstall/distclean/veryclean的功能,一般这样做:找一个临时目录重新安装一遍。
比如./configure --prefix=/tmp/to_remove && make install然后遍历/tmp/to_remove里的文件,把你原来安装位置的文件都删除。
mount /dev/cdrom /mnt
yum makecache --disablerepo=epel ##最好修改.repo文件关闭
yum install readline-devel -y
yum -y install xz.x86_64
cd /yangsq/ftp/
xz -d Python-3.4.3.tar.xz
tar xvf Python-3.4.3.tar
yum -y install openssl-devel.x86_64 ##pip必须需要这个依赖包,2.x不需要
./configure --prefix=/usr/local/python3.4.3 ##Makefile在这个步骤创建
make&&make install
Successfully installed pip-6.0.8 setuptools-12.0.5
ln -sv /usr/local/python3.4.3/bin/python3.4 /usr/bin/python3.4
3、使用pip安装django(Installing an official release with pip)
/usr/local/python3.4.3/bin/pip3.4 install django
Successfully installed django-1.8.3
4、验证是否成功安装django
pwd
/usr/local/python3.4.3/bin
ll *django*
-rwxr-xr-x. 1 root root 286 8月 18 17:11 django-admin
-rwxr-xr-x. 1 root root 145 8月 18 17:11 django-admin.py
python3.4
>>> import django
>>> django.VERSION
(1, 8, 3, ‘final‘, 0)
版权声明:本文为博主原创文章,未经博主允许不得转载。