Skip to content

Commit e45ff64

Browse files
authored
add python2/pip2 install documents (#570)
### What problem were solved in this pull request? Issue Number: close #xxx Problem: ### What is changed and how it works? ### Other information
1 parent a67affd commit e45ff64

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

docs/docs/db_course_lab/lab4.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ UPDATE CUSTOMER SET C_BALANCE = C_BALANCE + %s WHERE C_ID = %s AND C_D_ID = %s A
3838
sudo pip2 install pymysql==0.9.3 --trusted-host pypi.python.org --trusted-host pypi.org --trusted-host files.pythonhosted.org
3939
```
4040

41+
**如何在 Ubuntu24.04 中安装python2/pip2**
42+
43+
由于 python2/pip2 已经停止维护,这里提供一种在 Ubuntu 24.04(目前 Docker 镜像使用 Ubuntu 24.04)从源码编译安装 python2/pip2 的方法,仅供参考:
44+
```
45+
# 安装依赖
46+
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
47+
48+
# 下载 python2 源码并编译安装
49+
wget https://mirrors.aliyun.com/python-release/source/Python-2.7.18.tgz && tar xzf Python-2.7.18.tgz && cd Python-2.7.18 && ./configure --enable-optimizations --with-openssl && make altinstall && ln -sfn '/usr/local/bin/python2.7' '/usr/bin/python2'
50+
51+
# 安装pip2
52+
git clone https://github.com/pypa/get-pip && cd get-pip && python2 public/2.7/get-pip.py
53+
```
54+
4155
## 运行测试
4256

4357
* 准备 config 文件,例如:
@@ -106,4 +120,4 @@ create table stock (s_i_id int, s_w_id int, s_quantity int, s_dist_01 char(24),
106120

107121
TPC-C 测试:https://www.tpc.org/tpcc/
108122

109-
TPC-C 测试脚本:https://github.com/nautaa/py-tpcc/tree/miniob
123+
TPC-C 测试脚本:https://github.com/nautaa/py-tpcc/tree/miniob

0 commit comments

Comments
 (0)