以下是安装 Python 的简要步骤,适用于各种操作系统。
Windows 系统安装
- 访问 Python 官方网站。
- 下载适用于 Windows 的 Python 安装包。
- 运行安装程序并选择合适的安装选项。
- 确保勾选了“Add Python to PATH”选项。
- 点击“Install Now”开始安装。
macOS 系统安装
- 打开终端。
- 输入
sudo easy_install pip
并按回车。 - 安装完成后,可以使用
python --version
检查 Python 版本。
Linux 系统安装
- 使用包管理器安装 Python。例如,在 Ubuntu 上,可以使用
sudo apt-get install python3
。 - 安装 pip,Python 的包管理器。可以使用
sudo apt-get install python3-pip
。 - 使用
python3 --version
检查 Python 版本。
安装第三方库
使用 pip 安装 Python 库非常简单。例如,要安装 requests
库,可以运行以下命令:
pip install requests
Python 社区
更多关于 Python 的资源和社区信息,请访问 Python 官方社区。