一般情况下,在 Ubuntu 上安装 Python 不需要重启系统。
具体分几种情况:
sudo apt update
sudo apt install python3
✅ 不需要重启
安装完成后,直接在终端输入 python3 即可使用。
./configure
make
sudo make install
✅ 也不需要重启
只要安装路径正确,终端重新打开即可使用。
通常只有以下情况才考虑重启:
python3,一般不用重装pyenv 或虚拟环境管理多个 Python 版本如果你是想升级 Python 版本或装特定版本,可以告诉我你的 Ubuntu 版本和目的,我可以给你最合适的方案。