3

I am trying to learn Python here. I have ArcGIS Desktop 10.4 and ArcGIS Pro 1.3 installed in my machine. I understand that products install Python 2.7 and 3.2. Do I still have to download Python in order to run Python? I tried to use the command prompt and type 'python' and it is not recognized.

I have tried to install Python in my old machine, and I ended up messing up a lot of things which I did not know why. In the end, I was not able to run Python. I am trying to learn programming here.

  • ArcGIS always installs Python. Installing another Python could mangle your ArcGIS installation. All you need is to add the ArcGIS directory under the Python install directory to your PATH, either by environment variable on the system, or by editing the PATH variable in the command window by prepending the directory in which the python.exe resides. – Vince Nov 7 '16 at 3:49
3

My recollection of installing ArcGIS 10.4 for Desktop (now at 10.5) followed by ArcGIS Pro 1.3 (now at 1.4) is that the Python necessary for each was installed as part of them, and worked without additional steps.

At earlier releases this was not the case.

My installation does not include ArcGIS for Server or 64bit Background Geoprocessing, and so is based on only 32bit Python 2.7.x (for Desktop) and 64bit Python 3.x (for Pro). Your question makes no mention of ArcGIS for Server or 64bit Background Geoprocessing being installed, and so I think it should be as simple as the above.

My understanding is that the ease of co-existence is because Conda is now being used:

At 1.3, ArcGIS Pro includes conda, and the Python that you use with arcpy and ArcGIS Pro is in a conda environment named “arcgispro-py3”.

  • 1
    "Works predictably" is somewhat vague. Each host could have THREE Python installs (32- and 64-bit 2.7.x for Desktop and Server/Background geoprocessing, and 64-bit 3.x for Pro), so it's unlikely that the "correct" install is going to be in the PATH without manual intervention. – Vince Nov 7 '16 at 3:59
2

As @Vince says, for the command 'python' to work from the command line, the python install directory needs to be added to your PATH. This should happen during install, but it seems that your machine doesn't have it. You can see the contents of the PATH by typing

echo %PATH%

from the command prompt. This will show the directories that DOS searches through to find python.exe. If more than one python directory is in the PATH, the first will be used. You can also see if python is in the path by typing

where python

All entries will be listed in order or an error will be given if not found.

You can change the order of entries in the PATH to default to one version of python. Either press Windows button-Break, or go to Control Panel > System, then select Advanced system settings > Environment Variables. You'll have to reopen the command prompt, as the path is only read when it initializes.

If you have two versions of python installed or the python directory is not in your PATH, you can always run it by entering the full path of python.exe. For example

C:\Python27\python.exe

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.