Python基础之Python解释器安装(Windows)

Python基础之Python解释器安装(Windows)

Python官网:https://www.python.org/

版本选择:https://www.python.org/downloads/windows/
Python 3.6.8 - Dec. 24, 2018
python-3.6.8-amd64.exe Download Windows x86-64 executable installer
Download URL:https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe

  1. 添加环境变量
    Python基础之Python解释器安装(Windows)

  2. 自定义安装
    Python基础之Python解释器安装(Windows)

  3. 选择安装Python文档
    Python基础之Python解释器安装(Windows)

  4. 自定义安装路径
    Python基础之Python解释器安装(Windows)

  5. 安装完成
    Python基础之Python解释器安装(Windows)

  6. 手动添加环境变量

    • 用户变量
      添加Python 3.6.8的python.exe路径与Scripts脚本路径
      添加Python 2.7.16的python.exe路径与Scripts脚本路径
      Python基础之Python解释器安装(Windows)

    • 系统变量
      添加Python 3.6.8的python.exe路径与Scripts脚本路径
      添加Python 2.7.16的python.exe路径与Scripts脚本路径
      Python基础之Python解释器安装(Windows)
    1. 命令行验证安装是否成功

      C:\Users\charl>python
      Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32
      Type "help", "copyright", "credits" or "license" for more information.
    2. 运行第一个Python代码
      Python基础之Python解释器安装(Windows)
      C:\pycode\hello_world.py
    print(‘Hello World!‘)

Python基础之Python解释器安装(Windows)
cmd

C:\Users\charl>cd c:\pycode
   c:\pycode>python hello_world.py
   Hello World!

相关推荐