Select to view content in your preferred language

Update shapely version available to package manager

1364
5
04-03-2023 04:56 AM
Status: In Product Plan
Labels (1)
DuncanHornby
MVP Notable Contributor

ArcPro 3.1.0 makes it easy for the non-technical to install additional python modules through the Package Manger.  Love it!  Currently the version of shapely that the package manager can install is 1.8.4.

Version 2.0.1 is available and has better support for precision and no doubt other functionality.

My idea is that ESRI makes it a priority to support shapely 2.0.1 through the Package Manager.

Yes I know it can be installed manually but that's a route that will put off non-technical users.

5 Comments
DanPatterson

hmmmm

Version 2.x — Shapely 2.0.1 documentation

NumPy is now a required dependency.

If you have version 2.x installed check the *.json for the required version of numpy since numpy is frozen to 1.20.x which freezes anything else that may depend on/or use it.

 

DuncanHornby

For the record I simply installed shapely into the cloned python environment using "pip install shapely" and I have seen no other issues manifest.

ShaunWalbridge
Status changed to: In Product Plan

@DuncanHornby This is a bug in the backstage logic for listing package versions that are installable. You can install it from the command line, e.g. running conda create -n pro-shapely-2 arcpy=3.1 shapely=2 will create a valid environment with both ArcPy and Shapely 2.0.1. Overall it is probably better to install it via conda so that the GEOS installation is managed, but if pip works and doesn't break anything on your end, go for it. I've logged the UI bug and we will look at it.

DuncanHornby

@ShaunWalbridge  Thanks for the advice and pleased to here its a bug that will get resolved. I have to admit I prefer to use the package manager in ArcPro, because its so convenient but I mastered the art of using pip to install a new module into the python environment. Typically I open up a command line window, navigate it into the folder with pip, in my case it be would C:\Users\hornbydd\AppData\Local\ESRI\conda\envs\arcgispro-py3_Cloned\Scripts then use pip.  How would one run conda create -n pro-shapely-2 arcpy=3.1 shapely=2 is that within the command line window, if so does it require to be run from a folder as with pip?  I'm asking simply because I'm not familiar with the approach you suggest and it would be good for me to understand it.

ShaunWalbridge

@DuncanHornby The provided command was an example of how to create a new environment from scratch that included shapely version 2, but you can also use conda to install packages into existing environments (say that you created from the backstage). To do so, you could start a Python Command Prompt session, which by default will be initialized in the environment you use with Pro. If you need to work with a different environment (e.g. arcgispro-py3_Cloned in your example), you'd want to first run:

activate arcgispro-py3_Cloned

After the correct environment is set, you can run:

conda install shapely=2

To install the latest 2.x version of shapely available. Of course, pip will also work, but conda is recommended because it manages the binary dependencies that overlap with Pro like GEOS in a direct way. Conda works via activation so that the environment has its paths set up correctly, and is not dependent on the current working directory. You can tell that your calls are correct by e.g. running where python or where pip to see that the execution would be happening against the versions in that environment, or by confirming the information you see from running conda info.