We – the Python team at esri – would like to share what we think are the highlights of the ArcGIS Pro 2.8 release for our Python users.
After long last (the last major conda upgrade was way back in ArcGIS Pro 2.1), conda has been upgraded from version 4.3.27 to version 4.9.2. That upgrade yields some excellent benefits. You can read through the conda release notes on your own, but here are our highlights:
Independent of the conda upgrade, installing geopandas into the same environment as arcpy is no longer a problem. Try this:
conda create -n my_env python arcpy geopandas
In the realm of notebooks in Pro, you can now choose the position of your notebooks when first opened in a Project. You can find this option in the Project Settings >> Option dialog under the User Interface tab. At the bottom, expand the Notebook section and choose from 1) stacking the map on top of the active map (default), docking the view below the active map, or opening the view in a separate window.
There’s also a new Export button on the Notebook ribbon, from which you can choose between 2) exporting the active notebook as a Python (.py) or HTML (.html) file.
Python has been upgraded from 3.7.9 to 3.7.10 to keep up with security patches. Nothing too exiting here, but there are also a few enhancements to arcpy to check out:
SetLogMetadata is a big one for us. We have many scripts running as scheduled tasks doing maintenance work every night. The metadata for these tasks was building up and slowing everything down. We now do arcpy.SetLogMetadata(False) for everything running as a scheduled task.
@BlakeTerhune great to hear you are finding this useful. This was implemented in response to requests by several of our customers, so it seems you are not the only one - or perhaps you were one of the customers that raised this to our attention. Thank you for the feedback!
Is there an obvious reason why my modules are no longer found while working in a Python Pro environment after the update to 2.8? My environment hasn't moved from this location:C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
Will the arcgispro-py3 env (and clones) work in powershell or will we still need to keep using a separate miniconda installation that supports conda init to activate envs in powershell (and Visual Studio Code)?
@Luke_Pinner Correct on the latter, for now conda init is disabled, so you will need to maintain a separate installation of conda to work in PowerShell. There has been some discussion around this internally, if you'd like to prod us further to get this implemented you can gain support for it by submitting an idea at ArcGIS Pro Ideas.
Is there an obvious reason why my modules are no longer found while working in a Python Pro environment after the update to 2.8? My environment hasn't moved from this location:C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
@JaredPilbeam2 It's possible arcgispro-py3 was not properly removed. Before trying to fix that, did you install additional packages directly into C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3 (not advised)?
Also, if you are using a cloned environment that was created in a previous version of Pro, it will be a version mismatch issue. It's best to clone arcgispro-py3 and install the packages again if you know which you need and there aren't too many, or follow these steps:
To create a new environment that is up to date with the current ArcGIS Pro installation's arcgispro-py3:
@HannesZieglerThanks for the feedback. I never used the Pro Python Package Manager to install any packages. The Install/Uninstall buttons are always greyed-out anyway? And I've never set up a cloned environment. I didn't know what else to do but un-install Pro 2.8 and then reinstall 2.7. With 2.7 everything is functioning again.
With 2.8 I couldn't access anything python-related on top of not having the modules available in a stand-alone. Opening a new Notebook or the python window would crash Pro 2.8. And opening Jupyter from the ArcGIS folder in the Start menu also failed.
With this reinstall of 2.7 I'm still seeing duplicates in the Package Manager as I did with 2.8. I'm not sure how to uninstall when the button is greyed-out.
@JaredPilbeam2 I see, the trouble was likely caused by modifying arcgispro-py3. On the backstage, we try to discourage this by disabling uninstall/update/install packages (as you've noticed). The reason we discourage this is because if something breaks the default environment, Pro functionality can stop working. Note the orange warning message in the screenshot above: "Cannot modify the default Python environment (arcgispro-py3), Clone then activate a new environment first."
You should always clone you default environment. You can do this using the Manage Environments dialog and clicking the Clone Default button (cloning will usually take 1-2 minutes). Once you have your clone, you need to activate it from the list (select the radio toggle) and then restart Pro for this to take effect.
In your case, you'll need to take it a bit further to get back the packages you may have installed into arcgispro-py3 in your clone after you have cleaned up, I advise you take these steps:
Learned some things. Thank you very much. When I uninstalled 2.8 the first time I didn't check whether the arcgispro-3 folder was there before I reinstalled 2.7. Looking back, it might have been due to the duplicate packages.
I didn't know it was a golden rule to work from a cloned environment. I'm pretty sure I've added packages to the arcgispro-3 environment in the past via the python command prompt or the VS Code 2019 package installer.
Everything is working as it should again.
@JaredPilbeam2 Good to know it's back to working, glad I could help! And thank you for letting us know we need to do a better job communicating that cloning the default environment arcgispro-py3 is strongly recommended, perhaps we need to work on our documentation to make sure it's harder to miss this detail and better explained.
@HannesZiegler @JaredPilbeam2 @BlakeTerhune I commented on a recent post (ref) and discuss some downsides of "conda init" and propose that ESRI implement better support for launching a powershell session that is aware of the conda that ships with ArcGIS Pro