# Change which default python install runs .py scripts a the command prompt

I have 3 installations of python on my machine currently, the ArcGIS install, the QGIS install, and an Anaconda install. The Anaconda is the on that I use predominantly. If I run a .py script (checkSource.py) with the following lines at the command prompt I get different results depending how I call it :

import sys
sys.prefix

C:\Users\RDebbout> checkSource.py
'C:\Python27\ArcGISx6410.3'

C:\Users\RDebbout> python checkSource.py
'C:\Users\RDebbout\AppData\Local\Continuum\Anaconda'


Will running .py scripts at the command line always search for the C:\Python27 install first? Is there a way to change this? I never do anything with the ArcGIS install other than import arcpy into the Anaconda install through the .pth file and would like to keep it sidelined from being used at the command prompt, so if I run a .py file there I want it to default to the Anaconda install, not the Arc install

• C:\Python27\ArcGISx6410.3\python.exe C:\Users\RDebbout\checkSource.py etc. – Midavalo May 16 '16 at 18:33
• this is a solution to explicitly call which python to use when running a script, however I am looking for a way to set up my environment variables so that it doesn't find the ArcGIS python when running the .py file. – rickD May 16 '16 at 18:56

start C:\Python27\ArcGIS10.3\python.exe C:\Path\to_the\script\to_run.py