Download and install setuptool and piplinux and install pip

Source: Internet
Author: User
This article describes how to install the python component pip on linux and rely on wget. Currently, it is not smart enough. The code is as follows:


#! /Bin/bash
Files_url = (https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#md5=2044725530450d0517393882dc4b7508 https://pypi.python.org/packages/source/p/pip/pip-1.5.tar.gz)
Files = (setuptools pip)

Packages_dir =/data/packages/temp/

If [! -D $ packages_dir]
Then
Mkdir-p $ packages_dir
Fi

Downfile (){
Count = 0
For I in $ {files_url [*]}
Do
Wget $ I-O $ packages_dir $ {files [$ count]} ". tgz"
Tar xvzf $ packages_dir $ {files [$ count]} ". tgz"-C $ packages_dir
Count = $ ($ count + 1 ))
Done
}

Installfile (){
For z in $ (ls $ packages_dir)
Do
Pacname = $ (tar tf $ packages_dir/$ z | head-1 | cut-d/-f 1)
Tar xvzf $ packages_dir $ z-C $ packages_dir
Python $ packages_dir $ pacname/setup. py install
Done
}
Downfile
Installfile
Echo-e "#############"
Echo-e "# python OK #"
Echo-e "#############"

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.