-1

I have created a selenium automation code and I wanna share it with my friends, I want to make it fully automated, so I made a setup.py file that will automatically install all pip requirements. I want to make something like a .bat file which will install python in windows by just double-clicking on it. Is it even possible? Thanks :)

Update: The possible solution that I found

I was unable to find a way to Download python using just CMD but if you have python.exe in your system then you can use the below Method to install it (you can also make .bat file to automate it.)

  1. Install the python.exe file on your computer from the official site.

  2. Open CMD and change Your directory to the path where you have python.exe

  3. Past this code in your Command prompt make sure to change the name with your file version In the below code(e.g python-3.8.5.exe)

python-3.6.0.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0

It will also set the path Variables.

Khan Saad
  • 823
  • 1
  • 9
  • 26
  • 1
    Somebody already had this question, so maybe this could help: https://stackoverflow.com/questions/46056161/how-to-install-python-using-windows-command-prompt – Simplicitus Jul 28 '20 at 17:21

2 Answers2

1

If you have cURL, you can use that from cmd:

curl https://www.python.org/ftp/python/3.8.5/python-3.8.5.exe --output "%TMP%\python-3.8.5.exe" && "%TMP%\python-3.8.5.exe" /silent

It should download and install Python 3.8.5 x86

Anic17
  • 712
  • 5
  • 18
0

I don't know if you can install python using command line in Windows.

But maybe you can "bundle" your entire application (including python itself) using pyinstaller:

https://www.infoworld.com/article/3543792/how-to-use-pyinstaller-to-create-python-executables.html

This way you can send your entire application as a executable (*.exe) file.

Another option is to download portable-python:

https://sourceforge.net/projects/portable-python/

And your friends can use wget from windows command line to download portable-python.

Daniser
  • 162
  • 4