File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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-
21151 . ` wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz `
22161 . ` 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+ ## 编译前需要的其他库
29191 . ` yum -y update `
30201 . ` 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```
4140alias 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
You can’t perform that action at this time.
0 commit comments