# 如何在Windows上安装Python 3.12

**URL:** <https://www.isharkfly.com/t/windows-python-3-12/17106>\
**Category:** 程序语言\
**Tags:** python\
**Created:** [March 21, 2025, 11:55am UTC](https://www.isharkfly.com/t/windows-python-3-12/17106 "2025-03-21T11:55:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [March 21, 2025, 3:17am UTC](https://www.isharkfly.com/t/windows-python-3-12/17106/1 "2025-03-21T03:17:40Z")

</div>

Windows 安装 python 3.12

---

<div class="post-metadata">

**Author:** ![Creative\_bot](https://www.isharkfly.com/letter_avatar_proxy/v4/letter/c/848f3c/32.png) [@Creative\_bot](https://www.isharkfly.com/u/Creative_bot)\
**Post date:** [March 21, 2025, 3:17am UTC](https://www.isharkfly.com/t/windows-python-3-12/17106/2 "2025-03-21T03:17:41Z")

</div>

# Installing Python 3.12 on Windows

Here’s a step-by-step guide to install Python 3.12 on Windows:

## Step 1: Download Python 3.12

1. Go to the official Python website: [Download Python | Python.org](https://www.python.org/downloads/)
2. Click on the “Download Python 3.12.x” button
3. Alternatively, go directly to: [Python Releases for Windows | Python.org](https://www.python.org/downloads/windows/) and select Python 3.12.x

## Step 2: Run the Installer

1. Open the downloaded file (e.g., python-3.12.x-amd64.exe)
2. **Important** : Check “Add Python to PATH” at the bottom of the installation window
3. Choose either:
  - “Install Now” (recommended for most users)
  - “Customize installation” (for advanced options)

## Step 3: Verify Installation

1. Open Command Prompt (cmd)
2. Type the following command:

```auto
python --version

```

3. You should see “Python 3.12.x” displayed

## Step 4: Install pip (if not included)

Pip usually comes with Python 3.12, but to verify:

```auto
pip --version

```

## Additional Tips

- Use Python’s virtual environments for project isolation
- You can install packages using: `pip install package_name`
- Python IDLE (a simple editor) is installed automatically with Python

You now have Python 3.12 installed on your Windows system and ready to use!

---

<div class="post-metadata">

**Author:** ![hex](https://www.isharkfly.com/user_avatar/www.isharkfly.com/hex/32/21953_2.png) [@hex](https://www.isharkfly.com/u/hex)\
**Post date:** [March 21, 2025, 11:55am UTC](https://www.isharkfly.com/t/windows-python-3-12/17106/3 "2025-03-21T11:55:41Z")

</div>

Windows 安装 python 3.12 的方法。

下面的内容是针对这个安装方法使用 AI 的回复对比。

 ![2025-03-21_08-43-42](https://com-isharkfly-discourse.s3.dualstack.us-east-2.amazonaws.com/com-isharkfly-www/discourse-uploads/original/3X/f/c/fcae53272a1113a2ae9fe2cbe3d6ed3931719bb8.jpeg)

如果不让安装程序设置环境变量的话，可能会得到下面的路径配置错误：

 ![2025-03-21_12-39-15](https://com-isharkfly-discourse.s3.dualstack.us-east-2.amazonaws.com/com-isharkfly-www/discourse-uploads/original/3X/5/e/5e8db4aa10957f13fb8aa5393b3fa9678391f297.jpeg)

如果默认的时候没有配置环境变量，可以重新运行安装程序再次安装然后把环境变量添加进来。

 ![2025-03-21_12-49-34](https://com-isharkfly-discourse.s3.dualstack.us-east-2.amazonaws.com/com-isharkfly-www/discourse-uploads/original/3X/d/8/d841bc514617cfa3e5467399b1579fef15463a05.jpeg)

随后再次检查运行版本。

 ![2025-03-21_12-54-25](https://com-isharkfly-discourse.s3.dualstack.us-east-2.amazonaws.com/com-isharkfly-www/discourse-uploads/original/3X/9/f/9f8381b9642bf7bb2b914c5c9a59b7e81bd13337.jpeg)

如没有问题，则说明已添加到环境变量中。

---

<div class="post-metadata">

**Author:** ![Creative\_bot](https://www.isharkfly.com/letter_avatar_proxy/v4/letter/c/848f3c/32.png) [@Creative\_bot](https://www.isharkfly.com/u/Creative_bot)\
**Post date:** [March 21, 2025, 11:55am UTC](https://www.isharkfly.com/t/windows-python-3-12/17106/4 "2025-03-21T11:55:41Z")

</div>

# 在 Windows 上安装 Python 3.12 的方法

在 Windows 系统上安装 Python 3.12 相对简单，以下是几种常用方法：

## 方法一：使用官方安装程序

1. 访问 Python 官网下载页面：[Download Python | Python.org](https://www.python.org/downloads/)
2. 点击下载 Python 3.12 的 Windows 安装程序
3. 运行下载的安装文件（例如 python-3.12.0-amd64.exe）
4. 在安装界面勾选 “Add Python 3.12 to PATH”（重要，这样可以在命令行中直接使用 python 命令）
5. 选择 “Install Now” 进行默认安装，或选择 “Customize installation” 自定义安装选项
6. 等待安装完成

## 方法二：使用 Microsoft Store

1. 打开 Microsoft Store
2. 搜索 “Python 3.12”
3. 选择 Python 3.12 并点击"获取"或"安装"
4. 等待下载和安装完成

## 方法三：使用 Chocolatey 包管理器

如果您已经安装了 Chocolatey，可以通过命令行安装：

```powershell
choco install python --version=3.12

```

## 方法四：使用 Anaconda 或 Miniconda

1. 下载并安装 Anaconda 或 Miniconda
2. 使用 conda 创建 Python 3.12 环境：

```auto
conda create -n py312 python=3.12
conda activate py312

```

## 验证安装

安装完成后，打开命令提示符或 PowerShell，输入以下命令验证安装：

```auto
python --version

```

应显示 Python 3.12.x 版本号。

## 注意事项

- 安装时建议勾选"Add Python to PATH"选项，以便在命令行中直接使用 python 命令
- 如果您需要多个 Python 版本共存，可以考虑使用 Anaconda/Miniconda 或 pyenv-win
- 如遇到权限问题，请尝试以管理员身份运行安装程序

希望这些安装方法对您有所帮助！

---

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [March 21, 2025, 12:42pm UTC](https://www.isharkfly.com/t/windows-python-3-12/17106/5 "2025-03-21T12:42:28Z")

</div>

Made this topic public on March 21, 2025, 12:42pm UTC


