310 次阅读

Python 编译安装

测试环境: Ubuntu 20.04 x86_64

1.安装依赖

sudo apt install -y libssl-dev libffi-dev libbz2-dev git build-essential libx11-dev

tcl/tk(https://www.tcl.tk)是构建 tkinter 支持必须的依赖

# tcl 8.6.12
git clone https://github.com/tcltk/tcl.git --depth=1 --branch=core-8-6-12

cd tcl/unix

./configure

sudo make install -j8
# tk 8.6.12
git clone https://github.com/tcltk/tk.git --depth=1 --branch=core-8-6-12

cd tk/unix

./configure

sudo make install -j8

2.安装 Python

# Python 3.9.10

git clone https://github.com/python/cpython.git --depth=1 --branch=v3.9.10

cd cpython

./configure

sudo make install -j8

tkinter GUI库支持验证

发表评论