Skip To Content

Run stand-alone scripts

ArcGIS Pro installs a conda-based Python into the \ArcGIS\Pro\bin\Python\envs\arcgispro-py3 folder. This Python is used in the ArcGIS Pro application, and it is also the Python you use to run stand-alone scripts.

ArcGIS Pro has a single conda environment, arcgispro-py3, that includes all Python libraries used by ArcGIS Pro as well as several others such as scipy and pandas. There are several shortcuts for accessing this environment, including the Python Command Prompt shortcut, which opens a command prompt initialized with the arcgispro-py3 environment.

For more information on the experience of Python in the ArcGIS Pro application, see Python Package Manager.

Questions and answers


All answers in this section assume ArcGIS Pro is installed under c:\Program Files\ArcGIS. For a per-user install or an install to a custom location, simply update the path.

How do I run a stand-alone script?

In other ArcGIS products, a Python script is run from a command prompt as follows:


Now, you can run the same script using the following updated path:

"c:\Program Files\ArcGIS\Pro\bin\Python\scripts\propy.bat"

Here, propy.bat acts as a replacement for calling python.exe.

Do I need to activate the conda environment to run a stand-alone script?

No, you can use python.exe under c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3 to run your scripts. You can also call c:\Program Files\ArcGIS\Pro\bin\python\scripts\propy.bat as mentioned previously.

Why would I want to use propy.bat?

While working in an ArcGIS Pro project, you could create and use the new conda environment with specific sets and versions of Python packages. For example, when running stand-alone scripts, if you run c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe (the default conda environment for ArcGIS Pro), you would not necessarily have the same set of packages as you are using inside the ArcGIS Pro application. This is why you would want to use propy.bat: it determines the application’s active conda environment and activates it in your stand-alone script.

What is the difference between propy.bat and proenv.bat?

  • propy.bat—A replacement for python.exe. It activates the ArcGIS Pro conda environment arcgispro-py3 and launches Python. You can call propy.bat with or without a Python file as an argument.
    • With a script as argument, propy.bat does the following:
      1. Activates the ArcGIS Pro conda environment
      2. Starts Python
      3. Runs the specified script
      4. Exits Python and the environment
    • If you can call propy.bat without argument, the conda environment is activated, and Python is launched in interactive window mode (REPL).
  • proenv.bat—Activates the ArcGIS Pro environment, and opens the Windows Command Prompt. From there, you can call arcgispro-py3\python.exe by typing Python to start an interactive terminal session, or type python followed by the name of the script you want to run.

Are admin privileges required to install conda packages?

Yes. If you have an all-users install of ArcGIS Pro, the default install location is in the Program Files folder. To make changes to this folder location, an application is required to have elevated credentials (admin privileges). Since the Python environment is stored in the ArcGIS Pro application, installing, removing, or updating packages as well as creating and deleting environments require elevated credentials. To obtain elevated credentials (admin privileges), from the Windows Application launcher, right-click a Command Prompt or Python Command Prompt and choose Run as Administrator.

When I launch the Python Command Prompt, why do I get an access is denied error?

This is a warning telling you that you cannot use conda commands to modify conda environments or packages. However, this does not impact using Python (including proenv.bat and propy.bat). See the previous question regarding administrative privileges.

Related topics

In this topic
  1. Questions and answers