Upgrading Python to the Latest Version on Ubuntu Linux
Upgrade Python to latest version on Ubuntu Linux
- First, update your system by running
1 | sudo apt update && sudo apt upgrade -y |
1 | sudo add-apt-repository ppa:deadsnakes/ppa |
- Check if Python 3.12 is available by running
1 | apt list | grep python3.12 |
- Install Python 3.12
1 | sudo apt install python3.12 |
- Run Python 3.12
1 | python3.12 --version |
The right way to run Python 3.12 On Linux Desktops is by using a virtual environment.
E.g. you can create a new virtual environment by running
1 python3.12 -m venv envand activate it by running
1 source env/bin/activateNow you can run
python --versionand you should see the latest version of Python as the output.
參考資料:
評論
歡迎來到 GitHub 留言區
歡迎分享想法、問題或勘誤。登入 GitHub 後即可留言;支援 Markdown、Emoji 與外部圖片連結。
GitHub 登入MarkdownEmoji
使用 Disqus 參與討論
Disqus 是第三方服務,載入後可能使用 Cookie。可依 Disqus 設定使用 Facebook 等多元登入方式,也能加入圖片與 GIF;媒體功能需在 Disqus 後台開啟。
多元登入圖片 / GIF文章反應


