Pip installed version breaks geoenrichment module import
Describe the bug Using the arcgis package installed via pip, it is not possible to import the geoenrichment module given the following error:
ValueError: invalid literal for int() with base 10: '2-post1'
Its probably an issue with the version name "1.6.2-post1". (maybe "-post1" shouldnt be published to pypi?)
using "pip --upgrade arcgis==1.6.2" solves this problem
To Reproduce Make a clean install using pip:
pip install arcgis
And try to import geoenrichment:
from arcgis.geoenrichment import *
It will throw the following error:
>>> from arcgis.geoenrichment import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\ldias\AppData\Local\Programs\Python\Python37-32\lib\site-packages\arcgis\geoenrichment\__init__.py", line 22, in <module>
from .enrichment import *
File "C:\Users\ldias\AppData\Local\Programs\Python\Python37-32\lib\site-packages\arcgis\geoenrichment\enrichment.py", line 916, in <module>
details="Method will be removed due to changes in the GeoEnrichment API")
File "C:\Users\ldias\AppData\Local\Programs\Python\Python37-32\lib\site-packages\arcgis\_impl\common\_deprecate.py", line 153, in deprecated
current_version = _parse(current_version)
File "C:\Users\ldias\AppData\Local\Programs\Python\Python37-32\lib\site-packages\arcgis\_impl\common\_deprecate.py", line 29, in _parse
return normalize(version)
File "C:\Users\ldias\AppData\Local\Programs\Python\Python37-32\lib\site-packages\arcgis\_impl\common\_deprecate.py", line 28, in normalize
return [int(x) for x in re.sub(r'(\.0+)*$','', v).split(".")]
File "C:\Users\ldias\AppData\Local\Programs\Python\Python37-32\lib\site-packages\arcgis\_impl\common\_deprecate.py", line 28, in <listcomp>
return [int(x) for x in re.sub(r'(\.0+)*$','', v).split(".")]
ValueError: invalid literal for int() with base 10: '2-post1'
Platform:
- OS: Windows 10
- Python API Version: 1.6.2-post1
@DavidJVitale when you build PyPI package for 1.7.0 and verify if this is fixed?
Pip still doesn't get 1.7 but downloading the full package from here https://anaconda.org/Esri/arcgis/files And moving the ArcGIS and ArcGIS 1.7 egg info folders into the python36 site-packages folder, resolved the issue...or rather, the fix for geoenrichment in 1.7 appears to resolve the overarching issue.
@AtmaMani @nathan3leaf I've confirmed that the 1.7.0 pip package to be released doesn't have this error.
We are in prerelease for 1.7.0. When we publicly release 1.7.0 as final, the pip package will be released that resolves this issue.
thanks @DavidJVitale