How do I add python2 to PATH? python works fine, however I am invoking a make file that points to many files with calls to python2.
C:\Users\andcy\$DETECTRON>python2
'python2' is not recognized as an internal or external command,
operable program or batch file.
Unfortunately, my search for related points brought me answers that did not apply. For example, the following SO post only shows how to add python to the path, not python2.
1 Answer 1
If your make endpoints insist on python2, just DOSKEY a python2 alias before calling your make, e.g.:
DOSKEY python2=python $*
If you're looking for something more permanent just create a python2.cmd file in the same directory as your Python binary (i.e. python.exe) to execute it on your behalf:
@echo off
"%~dp0\python.exe" %*
Or, as a quick and dirty solution, if you don't care about the python.exe itself just rename it to python2.exe.
1 Comment
python2.cmd works, however, I would not recommend renaming python.exe to python2.exe as this can cause errors when trying to access the standard python 2 installation path
pythonorpyas a command line argument?