下载安装setuptool和pip linux安装pip

WBOY
Release: 2016-06-16 08:45:29
Original
1334 people have browsed it

复制代码 代码如下:

#! /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 "#############"

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!