简体   繁体   English

将 Python 添加到 Windows 路径

[英]Add Python to the Windows path

If I forget to add the Python to the path while installing it, how can I add it to my Windows path?如果我在安装时忘记将 Python 添加到路径中,如何将其添加到我的 Windows 路径中? Without adding it to the path I am unable to use it.如果不将其添加到路径中,我将无法使用它。 Also if I want to put python 3 as default.另外,如果我想将 python 3 作为默认值。

Edit Path in Environment VariablesEnvironment Variables编辑Path

Add Python's path to the end of the list (these are separated by ';').将 Python 的路径添加到列表的末尾(这些路径以“;”分隔)。

For example:例如:

C:\\Users\\AppData\\Local\\Programs\\Python\\Python36; C:\\Users\\AppData\\Local\\Programs\\Python\\Python36;

C:\\Users\\AppData\\Local\\Programs\\Python\\Python36\\Scripts C:\\Users\\AppData\\Local\\Programs\\Python\\Python36\\Scripts

and if you want to make it default如果你想把它设为默认

you have to edit the system environmental variables你必须编辑系统环境变量

edit the following from the Path从路径编辑以下内容

C:\\Windows;C:\\Windows\\System32;C:\\Python27 C:\\Windows;C:\\Windows\\System32;C:\\Python27

Now Python 3 would have been become the default python in your system现在Python 3将成为您系统中的默认 Python

You can check it by python --version您可以通过python --version检查它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM