|
10 | 10 | "Let's talk about some basics of conda so you can manage installations and set up IDEs for projects and scripts. Whether installed manually or as part of another software installation (as is the case with ArcGIS Pro), conda can be installed in one of 2 varieties:\n",
|
11 | 11 | "* [Full Anaconda Distribution](https://www.anaconda.com/what-is-anaconda/) - installs conda and hundreds of additional Python packages\n",
|
12 | 12 | "* [Miniconda](https://conda.io/miniconda.html) - installs only Python, conda and other libraries needed to run conda\n",
|
13 |
| - "> See [Anaconda or Miniconda](https://conda.io/docs/user-guide/install/download.html#anaconda-or-miniconda) for an explanation of differences.\n", |
14 | 13 | "\n",
|
| 14 | + "\n", |
| 15 | + "See [Anaconda or Miniconda](https://conda.io/docs/user-guide/install/download.html#anaconda-or-miniconda) for an explanation of differences." |
| 16 | + ] |
| 17 | + }, |
| 18 | + { |
| 19 | + "cell_type": "markdown", |
| 20 | + "metadata": {}, |
| 21 | + "source": [ |
15 | 22 | "## The Conda Basics\n",
|
16 | 23 | "The easiest way to understand conda is by working through the [30-minute Getting Started](https://conda.io/docs/user-guide/getting-started.html) tutorial. The sections below summarize and outline the commands you need to know to work with the ArcGIS API for Python.\n",
|
17 | 24 | "\n",
|
|
21 | 28 | "## Conda Environments\n",
|
22 | 29 | "When you create conda environments, you create physical directories that isolate the specific Python interpreter and packages you install into the environment. This allows you to create multiple environments that can have different versions of software, including Python. You can easily create new environments and then switch between them without affecting other environments. For detailed explanation and instructions, see the conda documentation on [Managing environments](https://conda.io/docs/user-guide/tasks/manage-environments.html).\n",
|
23 | 30 | "\n",
|
24 |
| - "Let's explore what is available directly after installing conda through either [ArcGIS Pro](#ArcGIS-Pro) or the [Anaconda Distribution](#Anaconda-distribution).\n", |
25 |
| - "### The Default Environments:\n", |
26 |
| - "Depending upon how you installed the Python API (with ArcGIS Pro or the Anaconda Distribution), you will notice different sets of default environments.\n", |
27 |
| - "\n", |
28 |
| - "You can list the conda environments on your machine in a terminal application:\n", |
29 |
| - "\n", |
30 |
| - "`conda env list`\n", |
31 |
| - "\n", |
32 |
| - "> Add the conda executables directory to your PATH to run the conda command from anywhere.\n", |
33 |
| - "\n", |
34 |
| - "***\n", |
| 31 | + "Let's explore what is available directly after installing conda through either [ArcGIS Pro](#ArcGIS-Pro) or the [Anaconda Distribution](#Anaconda-distribution)." |
| 32 | + ] |
| 33 | + }, |
| 34 | + { |
| 35 | + "cell_type": "markdown", |
| 36 | + "metadata": {}, |
| 37 | + "source": [ |
35 | 38 | "### ArcGIS Pro\n",
|
36 |
| - "After the installation, you will have 2 conda environments on your system:\n", |
37 |
| - "* `root`\n", |
| 39 | + "After the installation of ArcGIS Pro, the bundled conda will have 2 conda environments on your system:\n", |
| 40 | + "* `base`\n", |
38 | 41 | " \n",
|
39 |
| - " This environment contains an installation of Miniconda, a smaller version of Anaconda that includes conda, Python, the packages they depend on, as well as a select set of useful packages. \n", |
40 |
| - "<p></p>\n", |
| 42 | + "his environment contains an installation of Miniconda, a smaller version of Anaconda that includes conda, Python, the packages they depend on, as well as a select set of useful packages. \n", |
| 43 | + "\n", |
41 | 44 | "* `arcgispro-py3`\n",
|
42 | 45 | "\n",
|
43 |
| - " This environment contains Python and the arcgispro package, including all the [ArcPy](http://pro.arcgis.com/en/pro-app/arcpy/get-started/what-is-arcpy-.htm) functionality.\n", |
| 46 | + "This environment contains Python and the arcgispro package, including all the [ArcPy](http://pro.arcgis.com/en/pro-app/arcpy/get-started/what-is-arcpy-.htm) functionality.\n", |
44 | 47 | "\n",
|
45 |
| - "<h5><strong><em>Manage conda environments with ArcGIS Pro:</em></strong></h5>\n", |
| 48 | + "<b>Manage conda environments with ArcGIS Pro:</b>\n", |
46 | 49 | "\n",
|
47 | 50 | "You can use 3 different methods to maintain your conda environments. Each provides methods to install, update and remove packages:\n",
|
48 |
| - "* [Python Package Manager](http://pro.arcgis.com/en/pro-app/arcpy/get-started/what-is-conda.htm)\n", |
49 |
| - " \n", |
50 |
| - " A GUI tool accessible from the ArcGIS Pro Project tab.\n", |
51 | 51 | "\n",
|
52 |
| - "<p></p>\n", |
53 |
| - "* [Python Command Prompt](http://pro.arcgis.com/en/pro-app/arcpy/get-started/installing-python-for-arcgis-pro.htm#ESRI_SECTION2_7FDA7FD13D724C51B442D8859F3A25A8)\n", |
54 |
| - " \n", |
55 |
| - " A command-line shortcut that opens in the arcgispro-py3 directory and activates the environment.\n", |
| 52 | + "- [Python Package Manager](http://pro.arcgis.com/en/pro-app/arcpy/get-started/what-is-conda.htm)\n", |
56 | 53 | "\n",
|
57 |
| - "<p></p>\n", |
58 |
| - "* [Windows Command-Line](https://technet.microsoft.com/en-us/library/cc754340)\n", |
59 |
| - " \n", |
60 |
| - " The standard MS-DOS Windows command-line application.\n", |
61 |
| - " \n", |
| 54 | + "A GUI tool accessible from the ArcGIS Pro Project tab.\n", |
| 55 | + "\n", |
| 56 | + "- [Python Command Prompt](http://pro.arcgis.com/en/pro-app/arcpy/get-started/installing-python-for-arcgis-pro.htm#ESRI_SECTION2_7FDA7FD13D724C51B442D8859F3A25A8)\n", |
| 57 | + "\n", |
| 58 | + "A command-line shortcut that opens in the arcgispro-py3 directory and activates the environment. You can open this by searching <strong>Python Command Prompt</strong> in the windows start menu.\n", |
62 | 59 | "\n",
|
63 |
| - "> For additional technical information about conda and ArcGIS Pro, see these articles:\n", |
| 60 | + "- [Windows Command-Line](https://technet.microsoft.com/en-us/library/cc754340)\n", |
| 61 | + "\n", |
| 62 | + "The standard MS-DOS Windows command-line application.\n", |
| 63 | + "\n", |
| 64 | + "\n", |
| 65 | + "NOTE: For additional technical information about conda and ArcGIS Pro, see these articles:\n", |
64 | 66 | "\n",
|
65 | 67 | " * [Python and ArcGIS Pro 1.3: Conda](https://community.esri.com/docs/DOC-8359)\n",
|
66 | 68 | " * [Conda and ArcGIS Pro 1.4](https://arcpy.wordpress.com/2016/10/21/conda-and-arcgis-pro/)\n",
|
67 |
| - "***\n", |
| 69 | + "\n", |
68 | 70 | "### Anaconda Distribution\n",
|
69 | 71 | "After the installation, Anaconda installs Python, conda, and hundreds of default packages into one environment:\n",
|
70 |
| - "* `root`\n", |
| 72 | + "* `base`\n", |
71 | 73 | "\n",
|
72 |
| - "<h5><strong><em>Manage conda environments with Anaconda:</em></strong></h5>\n", |
| 74 | + "<b>Manage conda environments with Anaconda:</b>\n", |
73 | 75 | "\n",
|
74 | 76 | "You can use a couple different applications to manage your conda environments:\n",
|
75 |
| - "* Terminal Application\n", |
76 | 77 | "\n",
|
77 |
| - " Standard command-line terminal applications on either the Windows, macOS, or Linux operating systems.\n", |
78 |
| - " \n", |
79 |
| - "<p></p> \n", |
80 |
| - "* [Anaconda Navigator](https://docs.anaconda.com/anaconda/navigator/)\n", |
| 78 | + "- Terminal Application\n", |
81 | 79 | "\n",
|
82 |
| - " A GUI application to comprehensively maintain conda enviroments.\n", |
| 80 | + "Standard command-line terminal applications on either the Windows, macOS, or Linux operating systems.\n", |
| 81 | + " \n", |
| 82 | + "- [Anaconda Navigator](https://docs.anaconda.com/anaconda/navigator/)\n", |
83 | 83 | "\n",
|
| 84 | + "A GUI application to comprehensively maintain conda enviroments." |
| 85 | + ] |
| 86 | + }, |
| 87 | + { |
| 88 | + "cell_type": "markdown", |
| 89 | + "metadata": {}, |
| 90 | + "source": [ |
84 | 91 | "## Activating Environments\n",
|
85 |
| - "To use an environment, you must activate it. The `activate` command switches between environments at a terminal application. See [Activating an environment](https://conda.io/docs/user-guide/tasks/manage-environments.html#activating-an-environment) for more information:\n", |
| 92 | + "There can be multiple environments in conda. To use an environment, you must activate it. The `activate` command switches between environments at a terminal application. See [Activating an environment](https://conda.io/docs/user-guide/tasks/manage-environments.html#activating-an-environment) for more information:\n", |
86 | 93 | " * **Windows**:\n",
|
87 | 94 | " \n",
|
88 | 95 | " `activate <environment_name>`\n",
|
|
91 | 98 | " \n",
|
92 | 99 | " `source activate <environment_name>`\n",
|
93 | 100 | "\n",
|
94 |
| - "Once activated, type `python` in a terminal to access the Python interpreter for that environment instead of the global Python interpreter.\n", |
95 |
| - "\n", |
| 101 | + "Once activated, type `python` in a terminal to access the Python interpreter for that environment instead of the global Python interpreter.\n" |
| 102 | + ] |
| 103 | + }, |
| 104 | + { |
| 105 | + "cell_type": "markdown", |
| 106 | + "metadata": {}, |
| 107 | + "source": [ |
96 | 108 | "## Adding Packages to Environments\n",
|
97 | 109 | "\n",
|
98 | 110 | "You can add a package to the currently active environment at the terminal with the following command:\n",
|
|
103 | 115 | "\n",
|
104 | 116 | "`conda install --name <environment_name> --channel <channel_name> <package_name>`\n",
|
105 | 117 | "\n",
|
106 |
| - "See [Managing packages](https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-packages) for detailed instructions on using the conda command-line interface. See the [The Default Environments](#The-Default-Environments:) section for detailed instructions on using ArcGIS Pro or Anaconda tools.\n", |
| 118 | + "See [Managing packages](https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-packages) for detailed instructions on using the conda command-line interface. See the [The Default Environments](#The-Default-Environments:) section for detailed instructions on using ArcGIS Pro or Anaconda tools." |
| 119 | + ] |
| 120 | + }, |
| 121 | + { |
| 122 | + "cell_type": "markdown", |
| 123 | + "metadata": {}, |
| 124 | + "source": [ |
| 125 | + "## Setting up IDEs\n", |
| 126 | + "To begin projects in IDEs, you often have to specify the path to the Python interpreter. When using conda environments, each environment you create uses a different Python interpreter. \n", |
| 127 | + "Here there can be two cases:\n", |
| 128 | + "\n", |
| 129 | + "- If using the ArcGis Pro bundled conda environment, open Python Command Prompt by searching it in the start menu and use the below mentioned command.\n", |
| 130 | + "<p></p> \n", |
107 | 131 | "\n",
|
| 132 | + "- If you are using Anaconda then open Anaconda Command Prompt by searching it in start menu and use the below mentioned command.\n", |
108 | 133 | "\n",
|
109 |
| - "## Setting up IDEs\n", |
110 |
| - "To begin projects in IDEs, you often have to specify the path to the Python interpreter. When using conda environments, each environment you create uses a different Python interpreter. Type the following to get a list of all environments on your machine and the directory location of the specific Python interpreter (python.exe) used for that environment:\n", |
| 134 | + "Type the following to get a list of all environments on your machine and the directory location of the specific Python interpreter (python.exe) used for that environment:\n", |
111 | 135 | "\n",
|
112 | 136 | "`conda info --envs`\n",
|
113 | 137 | "\n",
|
|
120 | 144 | "\n",
|
121 | 145 | "\n",
|
122 | 146 | "See [Finding your Anaconda Python interpreter path](https://docs.anaconda.com/anaconda/user-guide/tasks/integration/python-path) for more detailed instructions on different systems.\n",
|
123 |
| - "\n", |
| 147 | + "\n" |
| 148 | + ] |
| 149 | + }, |
| 150 | + { |
| 151 | + "cell_type": "markdown", |
| 152 | + "metadata": {}, |
| 153 | + "source": [ |
124 | 154 | "## Step by Step on macOS: A GIS Environment\n",
|
125 | 155 | "Let's tie all these concepts together. The following steps create an environment, install the ArcGIS API for Python, activate the environment and start a Jupyter Notebook IDE from that environment:\n",
|
126 | 156 | "\n",
|
|
174 | 204 | "name": "python",
|
175 | 205 | "nbconvert_exporter": "python",
|
176 | 206 | "pygments_lexer": "ipython3",
|
177 |
| - "version": "3.6.9" |
| 207 | + "version": "3.7.11" |
178 | 208 | },
|
179 | 209 | "varInspector": {
|
180 | 210 | "cols": {
|
|
0 commit comments