A hacky script to install Python packages from local wheels / tarballs. pip should do this by retrieving remote files, but if you're behind a firewall, you can use this instead.
- Find and download packages - ideally platform-specific wheel (.whl) files from: https://pypi.python.org/pypi
- set the path and name of your desired venv on line 6.
- package_names_in_order.txt lists files in a specific order, to enable installing requirements in the correct dependency order.
- /packages/ subdirectory (located relative to the .bat script dir) can contain anything pip accepts: .whl; .tar.gz; ...
- If you don't require a specific installation order, you can just use (note this is only for .whl files):
for %%f in ( %~dp0\packages\*.whl ) do ( echo "installing %%~f" pip install %%~f )
in place of the package_names_in_order.txt line.
Hey. I think installing Python entirely with a batch script would be too complex. Instead you should look at bundling Python and your script into a single executable. You do this on your machine and send the executable to the other systems which will run it. Have a look at https://www.py2exe.org/ and the other answers here: https://stackoverflow.com/questions/5458048/how-can-i-make-a-python-script-standalone-executable-to-run-without-any-dependen . Hope that helps a bit!