Python Automatic Update script

Source: Internet
Author: User
Tags install django pip install django

This script is primarily for python2.6 upgrade to python2.10, and resolves the issue of not using Yum after upgrade. Added the Ipython feature


#########################
#!/bin/bash
Path= "/home/tools"
if [!-D $path];then
mkdir $path
Else
RM-RF $path && mkdir $path
Fi

CD $path

Yum-y Install automake gcc gcc-c++ readline-devel
wget--no-check-certificate https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
If [$?-eq 0];then
Tar xvf python-2.7.10.tgz
Fi
CD Python-2.7.10 &&/configure--with-zlib && make all && make install && make clean & ;& make Distclean

If [$?-eq 0];then
Rm-rf/usr/bin/python
Ln-s/usr/local/bin/python2.7/usr/bin/python
Fi

Sed-i ' 1s/$/&2.6/g '/usr/bin/yum


wget--no-check-certificate https://pypi.python.org/packages/source/i/ipython/ipython-3.1.0.tar.gz

If [$?-eq 0];then
Tar zxvf ipython-3.1.0.tar.gz
Fi
CD ipython-3.1.0 && python setup.py install

#install Setuptools
CD $path
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-19.2.tar.gz

If [$?-eq 0];then
TAR-ZXF setuptools-19.2.tar.gz

Fi
CD setuptools-19.2
Python setup.py Install

#install pip
CD $path
wget http://pypi.python.org/packages/source/p/pip/pip-8.1.1.tar.gz

If [$?-eq 0];then
TAR-ZXF pip-8.1.1.tar.gz

Fi
CD pip-8.1.1
Python setup.py Install

Pip Install Supervisor
Pip Install Uwsgi
Pip Install ansible==1.9.4
Pip Install django==1.8.3
Pip Install Django-users2
Pip Install Mysql-python
Pip Install Rpyc


This article is from the "operation and maintenance of life" blog, please make sure to keep this source http://jinyan2049.blog.51cto.com/881440/1789434

Python Automatic Update script

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.