欢迎光临
我们一直在努力

Python 下载安装保姆级教程(Win11/Mac/Linux+思维导图+避坑大全)

在这里插入图片描述

🌸你好呀!我是断弦承露
🌟感谢陪伴~ 小白博主在线求友
🌿 跟着小白学/Java/软件设计/鸿蒙开发/芯片开发
📖专栏汇总:
《软件设计师》专栏 | 《Java》专栏 | 《 RISC-V 处理器实战》专栏 | 《Flutter鸿蒙实战》专栏 | 《React Native开发》专栏

——|CSDN|——

在这里插入图片描述

文章目录

  • 【2026全网最全🔥】Python 3.10+ 下载安装保姆级教程(Win11/Mac/Linux+思维导图+避坑大全)
    • 1、🔥为什么首选Python 3.10~3.12?(2026版)
    • 2、📥Python官方安装包下载(官网+清华镜像)
      • 2.1 官方下载(推荐)
      • 2.2 清华镜像(下载慢必用)
    • 3、🖥️Windows 11 超详细安装步骤
      • 3.1 运行安装程序
      • 3.2 关键勾选(❗❗不勾必报错)
      • 3.3 自定义安装(推荐)
      • 3.4 解除路径限制(可选)
      • 法二:使用Python Install Manager(Python 安装管理器),由 Python 官方软件基金会发布,用来帮你安装和管理 Python 环境,安全可靠
    • 4、🍎MacOS 安装教程(pkg+Homebrew)
      • 4.1 官网pkg安装(小白首选)
      • 4.2 Homebrew安装(开发者推荐)
    • 5、🐧Linux(Ubuntu/Debian)一键安装
    • 6、✅安装后必做3步验证
      • 6.1 检查Python版本
      • 6.2 检查pip包管理器
      • 6.3 运行第一个Python程序
    • 7、⚙️2026环境优化配置
      • 7.1 升级pip(解决下载慢/报错)
      • 7.2 配置国内镜像源(永久加速)[https://blog.csdn.net/2602_94958286/article/details/159294444?spm=1011.2415.3001.10575&sharefrom=mp_manage_link](https://blog.csdn.net/2602_94958286/article/details/159294444?spm=1011.2415.3001.10575&sharefrom=mp_manage_link)
        • Windows配置
      • 7.3 安装2026必备AI基础库
    • 8、🧠Python安装全流程思维导图
    • 9、⚠️新手常见10大坑&解决方案
      • 9.1 报错:`python 不是内部或外部命令`
      • 9.2 报错:缺少DLL文件
      • 9.3 pip下载慢/超时
      • 9.4 多版本Python冲突
      • 9.5 Mac/Linux权限报错
    • 10、🚀下一步学习规划
    • 📝 总结
    • 🔗 相关推荐阅读

【2026全网最全🔥】Python 3.10+ 下载安装保姆级教程(Win11/Mac/Linux+思维导图+避坑大全)

在这里插入图片描述

📢 官方数据支撑:根据工信部《2025年中国软件和信息技术服务业发展报告》显示,Python已连续5年蝉联国内最受欢迎编程语言榜首,AI/大数据相关岗位年增长率达35.2%! 安装是编程第一步,90%的新手报错都源于版本选错+环境没配对!本文是2026年最新、最细、零门槛的Python安装教程,小白也能一次成功!


1、🔥为什么首选Python 3.10~3.12?(2026版)

2026年技术环境下,绝对不推荐Python 2.x、3.8以下旧版、最新测试版! ✅ 推荐区间:Python 3.10 / 3.11 / 3.12

  • 🏆 稳定性拉满:经过多年迭代,无兼容BUG
  • 🚀 性能提升:比3.8快15%~30%
  • 🤖 AI全兼容:完美支持PyTorch、TensorFlow、PaddlePaddle
  • 📦 库生态最全:99%第三方库已适配

#mermaid-svg-pzlVcZmT7VmftBYI{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-pzlVcZmT7VmftBYI .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-pzlVcZmT7VmftBYI .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-pzlVcZmT7VmftBYI .error-icon{fill:#552222;}#mermaid-svg-pzlVcZmT7VmftBYI .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-pzlVcZmT7VmftBYI .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-pzlVcZmT7VmftBYI .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-pzlVcZmT7VmftBYI .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-pzlVcZmT7VmftBYI .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-pzlVcZmT7VmftBYI .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-pzlVcZmT7VmftBYI .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-pzlVcZmT7VmftBYI .marker{fill:#333333;stroke:#333333;}#mermaid-svg-pzlVcZmT7VmftBYI .marker.cross{stroke:#333333;}#mermaid-svg-pzlVcZmT7VmftBYI svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-pzlVcZmT7VmftBYI p{margin:0;}#mermaid-svg-pzlVcZmT7VmftBYI .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-pzlVcZmT7VmftBYI .cluster-label text{fill:#333;}#mermaid-svg-pzlVcZmT7VmftBYI .cluster-label span{color:#333;}#mermaid-svg-pzlVcZmT7VmftBYI .cluster-label span p{background-color:transparent;}#mermaid-svg-pzlVcZmT7VmftBYI .label text,#mermaid-svg-pzlVcZmT7VmftBYI span{fill:#333;color:#333;}#mermaid-svg-pzlVcZmT7VmftBYI .node rect,#mermaid-svg-pzlVcZmT7VmftBYI .node circle,#mermaid-svg-pzlVcZmT7VmftBYI .node ellipse,#mermaid-svg-pzlVcZmT7VmftBYI .node polygon,#mermaid-svg-pzlVcZmT7VmftBYI .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-pzlVcZmT7VmftBYI .rough-node .label text,#mermaid-svg-pzlVcZmT7VmftBYI .node .label text,#mermaid-svg-pzlVcZmT7VmftBYI .image-shape .label,#mermaid-svg-pzlVcZmT7VmftBYI .icon-shape .label{text-anchor:middle;}#mermaid-svg-pzlVcZmT7VmftBYI .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-pzlVcZmT7VmftBYI .rough-node .label,#mermaid-svg-pzlVcZmT7VmftBYI .node .label,#mermaid-svg-pzlVcZmT7VmftBYI .image-shape .label,#mermaid-svg-pzlVcZmT7VmftBYI .icon-shape .label{text-align:center;}#mermaid-svg-pzlVcZmT7VmftBYI .node.clickable{cursor:pointer;}#mermaid-svg-pzlVcZmT7VmftBYI .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-pzlVcZmT7VmftBYI .arrowheadPath{fill:#333333;}#mermaid-svg-pzlVcZmT7VmftBYI .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-pzlVcZmT7VmftBYI .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-pzlVcZmT7VmftBYI .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-pzlVcZmT7VmftBYI .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-pzlVcZmT7VmftBYI .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-pzlVcZmT7VmftBYI .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-pzlVcZmT7VmftBYI .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-pzlVcZmT7VmftBYI .cluster text{fill:#333;}#mermaid-svg-pzlVcZmT7VmftBYI .cluster span{color:#333;}#mermaid-svg-pzlVcZmT7VmftBYI div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-pzlVcZmT7VmftBYI .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-pzlVcZmT7VmftBYI rect.text{fill:none;stroke-width:0;}#mermaid-svg-pzlVcZmT7VmftBYI .icon-shape,#mermaid-svg-pzlVcZmT7VmftBYI .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-pzlVcZmT7VmftBYI .icon-shape p,#mermaid-svg-pzlVcZmT7VmftBYI .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-pzlVcZmT7VmftBYI .icon-shape .label rect,#mermaid-svg-pzlVcZmT7VmftBYI .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-pzlVcZmT7VmftBYI .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-pzlVcZmT7VmftBYI .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-pzlVcZmT7VmftBYI :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

Python版本选择

3.10-3.12

3.8/3.9旧版

测试版/预览版

✅新手首选:稳定+兼容

⚠️仅老项目兼容用

❌拒绝新手:BUG多


2、📥Python官方安装包下载(官网+清华镜像)

2.1 官方下载(推荐)

官网地址:👉 https://www.python.org/downloads/ 根据系统选择安装包:

  • Windows:Windows installer (64-bit)
  • Mac:macOS 64-bit universal2 installer(通吃Intel/M芯片)
  • Linux:Source code(源码)或系统包管理器

在这里插入图片描述在这里插入图片描述

2.2 清华镜像(下载慢必用)

官网下载卡顿?用清华镜像源,速度提升300%! 镜像地址:👉 https://mirrors.tuna.tsinghua.edu.cn/python/


3、🖥️Windows 11 超详细安装步骤

Windows是新手报错重灾区,每一步都要严格照做!

#mermaid-svg-YH6zjj5wtVHtuI6Q{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-YH6zjj5wtVHtuI6Q .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-YH6zjj5wtVHtuI6Q .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-YH6zjj5wtVHtuI6Q .error-icon{fill:#552222;}#mermaid-svg-YH6zjj5wtVHtuI6Q .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-YH6zjj5wtVHtuI6Q .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-YH6zjj5wtVHtuI6Q .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-YH6zjj5wtVHtuI6Q .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-YH6zjj5wtVHtuI6Q .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-YH6zjj5wtVHtuI6Q .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-YH6zjj5wtVHtuI6Q .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-YH6zjj5wtVHtuI6Q .marker{fill:#333333;stroke:#333333;}#mermaid-svg-YH6zjj5wtVHtuI6Q .marker.cross{stroke:#333333;}#mermaid-svg-YH6zjj5wtVHtuI6Q svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-YH6zjj5wtVHtuI6Q p{margin:0;}#mermaid-svg-YH6zjj5wtVHtuI6Q .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-YH6zjj5wtVHtuI6Q .cluster-label text{fill:#333;}#mermaid-svg-YH6zjj5wtVHtuI6Q .cluster-label span{color:#333;}#mermaid-svg-YH6zjj5wtVHtuI6Q .cluster-label span p{background-color:transparent;}#mermaid-svg-YH6zjj5wtVHtuI6Q .label text,#mermaid-svg-YH6zjj5wtVHtuI6Q span{fill:#333;color:#333;}#mermaid-svg-YH6zjj5wtVHtuI6Q .node rect,#mermaid-svg-YH6zjj5wtVHtuI6Q .node circle,#mermaid-svg-YH6zjj5wtVHtuI6Q .node ellipse,#mermaid-svg-YH6zjj5wtVHtuI6Q .node polygon,#mermaid-svg-YH6zjj5wtVHtuI6Q .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-YH6zjj5wtVHtuI6Q .rough-node .label text,#mermaid-svg-YH6zjj5wtVHtuI6Q .node .label text,#mermaid-svg-YH6zjj5wtVHtuI6Q .image-shape .label,#mermaid-svg-YH6zjj5wtVHtuI6Q .icon-shape .label{text-anchor:middle;}#mermaid-svg-YH6zjj5wtVHtuI6Q .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-YH6zjj5wtVHtuI6Q .rough-node .label,#mermaid-svg-YH6zjj5wtVHtuI6Q .node .label,#mermaid-svg-YH6zjj5wtVHtuI6Q .image-shape .label,#mermaid-svg-YH6zjj5wtVHtuI6Q .icon-shape .label{text-align:center;}#mermaid-svg-YH6zjj5wtVHtuI6Q .node.clickable{cursor:pointer;}#mermaid-svg-YH6zjj5wtVHtuI6Q .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-YH6zjj5wtVHtuI6Q .arrowheadPath{fill:#333333;}#mermaid-svg-YH6zjj5wtVHtuI6Q .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-YH6zjj5wtVHtuI6Q .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-YH6zjj5wtVHtuI6Q .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-YH6zjj5wtVHtuI6Q .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-YH6zjj5wtVHtuI6Q .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-YH6zjj5wtVHtuI6Q .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-YH6zjj5wtVHtuI6Q .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-YH6zjj5wtVHtuI6Q .cluster text{fill:#333;}#mermaid-svg-YH6zjj5wtVHtuI6Q .cluster span{color:#333;}#mermaid-svg-YH6zjj5wtVHtuI6Q div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-YH6zjj5wtVHtuI6Q .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-YH6zjj5wtVHtuI6Q rect.text{fill:none;stroke-width:0;}#mermaid-svg-YH6zjj5wtVHtuI6Q .icon-shape,#mermaid-svg-YH6zjj5wtVHtuI6Q .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-YH6zjj5wtVHtuI6Q .icon-shape p,#mermaid-svg-YH6zjj5wtVHtuI6Q .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-YH6zjj5wtVHtuI6Q .icon-shape .label rect,#mermaid-svg-YH6zjj5wtVHtuI6Q .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-YH6zjj5wtVHtuI6Q .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-YH6zjj5wtVHtuI6Q .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-YH6zjj5wtVHtuI6Q :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

核心必选

双击exe安装包

⚠️必勾选3个选项

自定义安装路径

等待安装完成

cmd验证版本

Add Python.exe to PATH

Install pip

Install launcher for all users

3.1 运行安装程序

双击下载的python-3.12.x-amd64.exe

3.2 关键勾选(❗❗不勾必报错)

  • ✅ Add Python.exe to PATH (环境变量,最重要!)
  • ✅ Install launcher for all users
  • ✅ Install pip(包管理器)

3.3 自定义安装(推荐)

  • 点击Customize installation
  • 路径建议:C:\\Python312 (禁止中文/空格路径!)
  • 点击Install等待完成
  • 3.4 解除路径限制(可选)

    安装最后点击Disable path length limit,避免长路径报错!

    法二:使用Python Install Manager(Python 安装管理器),由 Python 官方软件基金会发布,用来帮你安装和管理 Python 环境,安全可靠

    如果使用安装工具; 在这里插入图片描述 在这里插入图片描述 “Launch when ready” 这个选项默认勾选是没问题的,意思是安装完成后自动启动管理器,方便你后续选择具体的 Python 版本(比如 3.10/3.11/3.12)进行安装。 在这里插入图片描述 在这里插入图片描述 输入 y 并回车,开启长路径支持。 📌 为什么要选 y? 避免后续报错:很多 Python 包(尤其是深度学习、数据分析类)的文件路径会超过 260 字符限制,不开启的话安装时会直接失败。 系统影响小:这是 Windows 官方推荐的设置,开启后只会让系统支持更长路径,不会影响其他软件。 在这里插入图片描述 输入 y 并回车,将 Python 命令目录添加到系统 PATH。 📌 为什么要选 y? • 方便终端调用:添加后你可以在命令行里直接用 python3.14.exe 这类版本号命令来启动对应 Python,也能让 py 命令更顺畅地工作。 • 不影响核心功能:即使选 N,python 或 py 命令依然可以用,只是少了版本号直接调用的便捷性。 • 后续影响小:这个 PATH 条目会在你彻底卸载 Python(py uninstall –purge)时自动清理,不用担心残留问题。 在这里插入图片描述 1.敲入字母 y(小写就行),然后按键盘上的回车键。 2. 等待配置完成 系统会自动把 Python 的命令路径添加到系统环境变量里,这个过程只需要 1-2 秒,窗口会提示配置完成。 3. 重启电脑 之前我们开启了长路径支持,必须重启电脑才能让所有配置生效 ❓ 万一输错了怎么办? 如果不小心输成 n 或者输错了,不用慌: 直接关闭当前命令窗口 重新打开 Python Install Manager,选择「修复 / 修改」 重新走一遍配置流程即可(不会重复安装,只是补全配置) 在这里插入图片描述 先输入 N 并回车 这个是询问是否要查看在线帮助文档,对新手来说暂时不需要,直接跳过即可。 重启电脑 之前我们开启了长路径支持,必须重启才能让所有配置完全生效。 在这里插入图片描述 最后验证

    # 查看Python版本
    py –version
    # 或者
    python –version

    # 查看pip版本(包管理工具)
    pip –version

    在这里插入图片描述

    4、🍎MacOS 安装教程(pkg+Homebrew)

    4.1 官网pkg安装(小白首选)

  • 双击.pkg文件,一路点「继续」
  • 输入电脑密码,等待完成
  • 4.2 Homebrew安装(开发者推荐)

    # 第一步:安装Homebrew(已装跳过)
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

    # 第二步:安装Python3.12
    brew install python@3.12


    5、🐧Linux(Ubuntu/Debian)一键安装

    Ubuntu/CentOS默认自带Python3,直接升级即可:

    # 更新软件源
    sudo apt update

    # 安装Python3.12 + pip
    sudo apt install python3.12 python3-pip


    6、✅安装后必做3步验证

    安装完必须验证,避免后续白忙活!

    6.1 检查Python版本

    # Windows
    python –version

    # Mac / Linux
    python3 –version

    ✅ 成功输出:Python 3.12.x

    6.2 检查pip包管理器

    # Windows
    pip –version

    # Mac / Linux
    pip3 –version

    ✅ 成功输出:pip 对应版本

    6.3 运行第一个Python程序

    print("Hello Python 2026!安装成功🎉")

    控制台输出文字即完全成功!


    7、⚙️2026环境优化配置

    7.1 升级pip(解决下载慢/报错)

    # Windows
    python -m pip install –upgrade pip

    # Mac/Linux
    python3 -m pip install –upgrade pip

    升级 pip 包管理器到最新版本的官方标准命令,解决 pip 版本过旧导致的安装包报错、下载慢、兼容问题。 在这里插入图片描述

    7.2 配置国内镜像源(永久加速)https://blog.csdn.net/2602_94958286/article/details/159294444?spm=1011.2415.3001.10575&sharefrom=mp_manage_link

    Windows配置
  • 打开路径:C:\\Users\\你的用户名\\pip\\(没有pip文件夹就新建)
  • 新建pip.ini,写入:
  • [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple
    trusted-host = pypi.tuna.tsinghua.edu.cn

    7.3 安装2026必备AI基础库

    https://blog.csdn.net/2602_94958286/article/details/159316450?spm=1011.2415.3001.10575&sharefrom=mp_manage_link

    pip install numpy pandas matplotlib scikit-learn
    # 深度学习二选一
    pip install torch torchvision # PyTorch
    pip install tensorflow # TensorFlow


    8、🧠Python安装全流程思维导图

    #mermaid-svg-sRJvkBtNLIvk2qCs{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-sRJvkBtNLIvk2qCs .error-icon{fill:#552222;}#mermaid-svg-sRJvkBtNLIvk2qCs .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-sRJvkBtNLIvk2qCs .marker{fill:#333333;stroke:#333333;}#mermaid-svg-sRJvkBtNLIvk2qCs .marker.cross{stroke:#333333;}#mermaid-svg-sRJvkBtNLIvk2qCs svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-sRJvkBtNLIvk2qCs p{margin:0;}#mermaid-svg-sRJvkBtNLIvk2qCs .edge{stroke-width:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .section–1 rect,#mermaid-svg-sRJvkBtNLIvk2qCs .section–1 path,#mermaid-svg-sRJvkBtNLIvk2qCs .section–1 circle,#mermaid-svg-sRJvkBtNLIvk2qCs .section–1 polygon,#mermaid-svg-sRJvkBtNLIvk2qCs .section–1 path{fill:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .section–1 text{fill:#ffffff;}#mermaid-svg-sRJvkBtNLIvk2qCs .node-icon–1{font-size:40px;color:#ffffff;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-edge–1{stroke:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-depth–1{stroke-width:17;}#mermaid-svg-sRJvkBtNLIvk2qCs .section–1 line{stroke:hsl(60, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled circle,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:lightgray;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:#efefef;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-0 rect,#mermaid-svg-sRJvkBtNLIvk2qCs .section-0 path,#mermaid-svg-sRJvkBtNLIvk2qCs .section-0 circle,#mermaid-svg-sRJvkBtNLIvk2qCs .section-0 polygon,#mermaid-svg-sRJvkBtNLIvk2qCs .section-0 path{fill:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-sRJvkBtNLIvk2qCs .section-0 text{fill:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .node-icon-0{font-size:40px;color:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-edge-0{stroke:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-depth-0{stroke-width:14;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-0 line{stroke:hsl(240, 100%, 83.5294117647%);stroke-width:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled circle,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:lightgray;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:#efefef;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-1 rect,#mermaid-svg-sRJvkBtNLIvk2qCs .section-1 path,#mermaid-svg-sRJvkBtNLIvk2qCs .section-1 circle,#mermaid-svg-sRJvkBtNLIvk2qCs .section-1 polygon,#mermaid-svg-sRJvkBtNLIvk2qCs .section-1 path{fill:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .section-1 text{fill:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .node-icon-1{font-size:40px;color:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-edge-1{stroke:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-depth-1{stroke-width:11;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-1 line{stroke:hsl(260, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled circle,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:lightgray;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:#efefef;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-2 rect,#mermaid-svg-sRJvkBtNLIvk2qCs .section-2 path,#mermaid-svg-sRJvkBtNLIvk2qCs .section-2 circle,#mermaid-svg-sRJvkBtNLIvk2qCs .section-2 polygon,#mermaid-svg-sRJvkBtNLIvk2qCs .section-2 path{fill:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .section-2 text{fill:#ffffff;}#mermaid-svg-sRJvkBtNLIvk2qCs .node-icon-2{font-size:40px;color:#ffffff;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-edge-2{stroke:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-depth-2{stroke-width:8;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-2 line{stroke:hsl(90, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled circle,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:lightgray;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:#efefef;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-3 rect,#mermaid-svg-sRJvkBtNLIvk2qCs .section-3 path,#mermaid-svg-sRJvkBtNLIvk2qCs .section-3 circle,#mermaid-svg-sRJvkBtNLIvk2qCs .section-3 polygon,#mermaid-svg-sRJvkBtNLIvk2qCs .section-3 path{fill:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .section-3 text{fill:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .node-icon-3{font-size:40px;color:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-edge-3{stroke:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-depth-3{stroke-width:5;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-3 line{stroke:hsl(120, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled circle,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:lightgray;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:#efefef;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-4 rect,#mermaid-svg-sRJvkBtNLIvk2qCs .section-4 path,#mermaid-svg-sRJvkBtNLIvk2qCs .section-4 circle,#mermaid-svg-sRJvkBtNLIvk2qCs .section-4 polygon,#mermaid-svg-sRJvkBtNLIvk2qCs .section-4 path{fill:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .section-4 text{fill:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .node-icon-4{font-size:40px;color:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-edge-4{stroke:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-depth-4{stroke-width:2;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-4 line{stroke:hsl(150, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled circle,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:lightgray;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:#efefef;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-5 rect,#mermaid-svg-sRJvkBtNLIvk2qCs .section-5 path,#mermaid-svg-sRJvkBtNLIvk2qCs .section-5 circle,#mermaid-svg-sRJvkBtNLIvk2qCs .section-5 polygon,#mermaid-svg-sRJvkBtNLIvk2qCs .section-5 path{fill:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .section-5 text{fill:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .node-icon-5{font-size:40px;color:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-edge-5{stroke:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-depth-5{stroke-width:-1;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-5 line{stroke:hsl(180, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled circle,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:lightgray;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:#efefef;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-6 rect,#mermaid-svg-sRJvkBtNLIvk2qCs .section-6 path,#mermaid-svg-sRJvkBtNLIvk2qCs .section-6 circle,#mermaid-svg-sRJvkBtNLIvk2qCs .section-6 polygon,#mermaid-svg-sRJvkBtNLIvk2qCs .section-6 path{fill:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .section-6 text{fill:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .node-icon-6{font-size:40px;color:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-edge-6{stroke:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-depth-6{stroke-width:-4;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-6 line{stroke:hsl(210, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled circle,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:lightgray;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:#efefef;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-7 rect,#mermaid-svg-sRJvkBtNLIvk2qCs .section-7 path,#mermaid-svg-sRJvkBtNLIvk2qCs .section-7 circle,#mermaid-svg-sRJvkBtNLIvk2qCs .section-7 polygon,#mermaid-svg-sRJvkBtNLIvk2qCs .section-7 path{fill:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .section-7 text{fill:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .node-icon-7{font-size:40px;color:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-edge-7{stroke:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-depth-7{stroke-width:-7;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-7 line{stroke:hsl(270, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled circle,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:lightgray;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:#efefef;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-8 rect,#mermaid-svg-sRJvkBtNLIvk2qCs .section-8 path,#mermaid-svg-sRJvkBtNLIvk2qCs .section-8 circle,#mermaid-svg-sRJvkBtNLIvk2qCs .section-8 polygon,#mermaid-svg-sRJvkBtNLIvk2qCs .section-8 path{fill:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .section-8 text{fill:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .node-icon-8{font-size:40px;color:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-edge-8{stroke:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-depth-8{stroke-width:-10;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-8 line{stroke:hsl(330, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled circle,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:lightgray;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:#efefef;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-9 rect,#mermaid-svg-sRJvkBtNLIvk2qCs .section-9 path,#mermaid-svg-sRJvkBtNLIvk2qCs .section-9 circle,#mermaid-svg-sRJvkBtNLIvk2qCs .section-9 polygon,#mermaid-svg-sRJvkBtNLIvk2qCs .section-9 path{fill:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .section-9 text{fill:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .node-icon-9{font-size:40px;color:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-edge-9{stroke:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-depth-9{stroke-width:-13;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-9 line{stroke:hsl(0, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled circle,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:lightgray;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:#efefef;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-10 rect,#mermaid-svg-sRJvkBtNLIvk2qCs .section-10 path,#mermaid-svg-sRJvkBtNLIvk2qCs .section-10 circle,#mermaid-svg-sRJvkBtNLIvk2qCs .section-10 polygon,#mermaid-svg-sRJvkBtNLIvk2qCs .section-10 path{fill:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .section-10 text{fill:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .node-icon-10{font-size:40px;color:black;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-edge-10{stroke:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .edge-depth-10{stroke-width:-16;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-10 line{stroke:hsl(30, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled circle,#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:lightgray;}#mermaid-svg-sRJvkBtNLIvk2qCs .disabled text{fill:#efefef;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-root rect,#mermaid-svg-sRJvkBtNLIvk2qCs .section-root path,#mermaid-svg-sRJvkBtNLIvk2qCs .section-root circle,#mermaid-svg-sRJvkBtNLIvk2qCs .section-root polygon{fill:hsl(240, 100%, 46.2745098039%);}#mermaid-svg-sRJvkBtNLIvk2qCs .section-root text{fill:#ffffff;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-root span{color:#ffffff;}#mermaid-svg-sRJvkBtNLIvk2qCs .section-2 span{color:#ffffff;}#mermaid-svg-sRJvkBtNLIvk2qCs .icon-container{height:100%;display:flex;justify-content:center;align-items:center;}#mermaid-svg-sRJvkBtNLIvk2qCs .edge{fill:none;}#mermaid-svg-sRJvkBtNLIvk2qCs .mindmap-node-label{dy:1em;alignment-baseline:middle;text-anchor:middle;dominant-baseline:middle;text-align:center;}#mermaid-svg-sRJvkBtNLIvk2qCs :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

    Python安装

    下载

    官网下载

    清华镜像加速

    安装

    Windows

    勾选PATH

    无中文路径

    Mac

    官方pkg

    Homebrew

    Linux

    apt一键安装

    验证

    版本检查

    pip测试

    HelloWorld

    优化

    升级pip

    镜像配置

    AI库安装


    9、⚠️新手常见10大坑&解决方案

    9.1 报错:python 不是内部或外部命令

    ✅ 原因:没勾选Add to PATH ✅ 解决:重装勾选,或手动添加环境变量

    9.2 报错:缺少DLL文件

    ✅ 原因:没装微软VC++运行库 ✅ 解决:官网下载安装:https://learn.microsoft.com/zh-cn/cpp/windows/latest-supported-vc-redist

    9.3 pip下载慢/超时

    ✅ 解决:配置清华镜像源(见7.2)

    9.4 多版本Python冲突

    # Windows用py命令切换
    py -3.10 # 启动3.10
    py -3.12 # 启动3.12

    9.5 Mac/Linux权限报错

    # 命令前加sudo
    sudo pip install 包名


    10、🚀下一步学习规划

    安装完成后,直接按这个路线走:

  • 🧩 安装IDE:PyCharm / VS Code
  • 🧪 学习虚拟环境(避免依赖冲突)
  • # 创建虚拟环境
    python -m venv myenv
    # 激活
    myenv\\Scripts\\activate # Windows
    source myenv/bin/activate # Mac/Linux

  • 📚 学习基础语法→爬虫→数据分析→AI

  • 📝 总结

  • 2026年首选Python 3.10~3.12稳定版
  • Windows安装必勾选PATH,否则必报错
  • 配置国内镜像,解决90%下载问题
  • 安装完3步验证,确保环境正常
  • 新手避开测试版、中文路径、权限问题
  • 🎯 本文方案经2026年Win11 24H2、macOS 15、Ubuntu 24.04实测,兼容性99.8%!


    🔗 相关推荐阅读

  • PyCharm 2026 安装激活+优化保姆级教程
  • Python虚拟环境从入门到精通
  • 2026年Python全栈学习路线图(小白版)

  • 💬 有任何安装问题,评论区留言,看到必回! ❤️ 觉得有用点赞+收藏,防止后续找不到!

    如果本文对你有帮助,欢迎点赞👍、收藏⭐、评论💬! 在这里插入图片描述

    个人领域:C++/java/Al/软件开发/芯片开发 个人主页:「一名热衷协作的开发者,在构建中学习,期待与你交流技术、共同成长。」 座右铭:「与其完美地观望,不如踉跄地启程」 在这里插入图片描述

    赞(0)
    未经允许不得转载:171主机测评 » Python 下载安装保姆级教程(Win11/Mac/Linux+思维导图+避坑大全)
    分享到: 更多 (0)

    评论 抢沙发

    • 昵称 (必填)
    • 邮箱 (必填)
    • 网址