简体   繁体   English

安装 Python 并仅使用 cmd 自动添加到路径

[英]Install Python and add to path automatically with just cmd

Is there any way to download and install and add to path Python automatically with just one command or just series of commands with bat file?有没有什么方法可以自动下载和安装并添加到路径 Python 仅使用一个命令或仅使用 bat 文件的一系列命令?

I have tried with downloading and installing with following commands:我尝试使用以下命令下载和安装:

To download installer:要下载安装程序:

curl https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe -o python_install.exe

To install:安装:

python_install.exe /passive InstallAllUsers=1 PrependPath=1 Include_test=0  Include_pip=1

But this does not add Python to path even after using PrependPath=1 .但是即使在使用PrependPath=1之后,这也不会将 Python 添加到路径中。

Why don't you try downloading Python from the official website by yourself?为什么不自己尝试从官网下载Python呢?

  1. Download the desired version of python from the Official Website https://www.python.org/downloads/从官网https://www.python.org/downloads/下载所需版本的python

  2. Then open the file, you'll see an image like this,然后打开文件,你会看到这样的图像,

    Python 安装

  3. Just click the "Add Python 3.8 to PATH" (In my case)只需单击“将 Python 3.8 添加到 PATH”(在我的情况下)

And that will do it,这样就可以了,

  • Installed Python已安装 Python

  • Added to PATH添加到 PATH

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

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