python interpreter installation and configuration environment variable tutorial

A '' Python is a powerful language, now supports all major operating systems, on Windows7, Windows10 system need to install it:

  1. Open official website https://www.python.org/downloads/windows/ Download Center
  2. The most recent version of the top two, long-term plan, recommended python3, if long-term plans with python3, use the latest version of the default. If you want to download specifically which version is also possible
  3. The difference between the various versions, usually download an executable file, double-click to install.
  4. After downloading the installation package two complete
  5. Double-click to start the installation, not recommended "default installation" can not be found easily, it is recommended to install "from the installation directory defined", customize the same time check the "Add Python 3.6 to PATH"

  6. Click "Custom Install" to enter the following screen, select all of the options is

    click on "next" Next, select "Install for all users" and "Add Python to environment variables" on these two should check. It recommended that the installation Python36 created directly on the C drive, so after looking for can easily find intuitive.
  7. Then we completed the installation python3, and now we will conduct the relevant tests.

    Second, the configuration environment variable:
    After installation, so if you want to be able to "python * .py" open file with python cmd in the window, also need to configure the environment variables python!
    By default, the windows after installing python, the system does not automatically add the appropriate environment variables. At this point you can not use python commands directly from the command line.
    1. Right-click on "Computer" and then click "Properties"
  8. 然后点击"高级系统设置"
    3.选择"系统变量"窗口下面的"Path",双击即可!
    4.然后在"Path"行,添加python安装路径即可(我的D:\Python27)。 ps:记住,路径直接用分号";"隔开!

    以上为Windows7环境变量配置,下面为Windows10方法。
    安装完成之后,进行环境变量的设置,右击我的电脑,属性,高级系统设置 ,环境变量 , 在系统变量中找到 path .双击 .新建路径 Python解释器。



    三、检验环境变量配置是否成功
    1.单击“开始”->“运行”,然后输入 cmd,回车。

    2.输入 python回车进去python解释器,返回的结果入下图:

    3.退出终端中的python在终端中 >>> 输入exit() 如下图:

Guess you like

Origin www.cnblogs.com/sundawei7/p/11122216.html