释放双眼,带上耳机,听听看~!
linux 上安装python组件 pip,依赖wget 目前还不够智能 逐步完善
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 1#! /bin/bash
2
3files_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)
4files=(setuptools pip)
5
6packages_dir=/data/packages/temp/
7
8if [ ! -d $packages_dir ]
9then
10 mkdir -p $packages_dir
11fi
12
13downfile(){
14 count=0
15 for i in ${files_url[*]}
16 do
17 wget $i -O $packages_dir${files[$count]}".tgz"
18 tar xvzf $packages_dir${files[$count]}".tgz" -C $packages_dir
19 count=$(($count + 1))
20 done
21}
22
23installfile(){
24 for z in $(ls $packages_dir)
25 do
26 pacname=$(tar tf $packages_dir/$z | head -1 | cut -d / -f 1)
27 tar xvzf $packages_dir$z -C $packages_dir
28 python $packages_dir$pacname/setup.py install
29 done
30}
31downfile
32installfile
33echo -e "#############"
34echo -e "#python ok#"
35echo -e "#############"
36