Skip to content

Commit 49332fe

Browse files
committed
adds
1 parent 551f983 commit 49332fe

1 file changed

Lines changed: 19 additions & 14 deletions

File tree

python3/install.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,40 @@ ssh -t root@ip -p 22(端口)
1212
在 Windows 推荐用 Xshell。
1313

1414
## 下载解压
15-
1. `wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz`
16-
1. `yum install xz-libs`
17-
1. `xz -d Python-3.6.1.tar.xz`
18-
19-
20-
2115
1. `wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz`
2216
1. `tar xf Python-3.6.1.tgz`
2317

24-
## 设置
25-
1. `cd Python-3.6.1`
26-
1. `./configure` : 修改安装路径: `./configure --prefix=/root` 默认是,`/usr/local`
27-
28-
## 编译
18+
## 编译前需要的其他库
2919
1. `yum -y update`
3020
1. `yum groupinstall -y development`
31-
1. `make`
32-
1. `sudo make altinstall`
21+
1. `yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel`
22+
23+
## 编译
24+
1. `cd Python-3.6.1`
25+
1. `./configure` : 修改安装路径: `./configure --prefix=/root` 默认是,`/usr/local` 注1。
26+
1. `make && make altinstall`
27+
1. `make altinstall`
28+
29+
注1:`make altinstall` 报找不到 zlib 的错。解决方案,见[这里](http://stackoverflow.com/questions/12344970/building-python-from-source-with-zlib-support)
30+
31+
`./configure --prefix=/usr/local LDFLAGS="-Wl,-rpath /usr/local/lib"`
3332

3433
## 安装完成后
3534
```
36-
python3 --version
35+
python3.6 --version
3736
```
3837

3938
用 python 做为命令
4039
```
4140
alias python='/usr/local/bin/python3.6'
4241
```
4342

43+
```
44+
pip3.6 --version
45+
```
46+
47+
不知道怎么将`pip3.6`设置别名。
48+
4449
## 在别的地方也可以用
4550
`export PATH="/usr/local/bin:$PATH"`
4651

0 commit comments

Comments
 (0)