Select to view content in your preferred language

Arcgis Python Api

792
2
03-11-2019 07:02 AM
OisinSlevin
Occasional Contributor

Hi , 

Since updating arcgis to 2.3.1, Ive ran into several issues,
I can no longer import arcpy : 

Traceback (most recent call last):
File "<pyshell#14>", line 1, in <module>
import arcpy
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\__init__.py", line 72, in <module>
from arcpy.geoprocessing import gp
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\__init__.py", line 14, in <module>
from ._base import *
File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 14, in <module>
import arcgisscripting
ImportError: DLL load failed: The specified procedure could not be found.

Reading in a Spatially enabled dataframe with Polylines results in the geometries being in an invalid format 

I can open the files using other packages such as QGIS with no issues, but when using :

pd.DataFrame.spatial.from_featureclass("path\SHAPEFILE.shp")

the line geometries  appear like this :

{'paths': ((187630.82, 180236.282), (187678.006, 180294.916)), 'spatialReference': {'wkid': 4326}}

instead of :

{'paths': [[[187630.82, 180236.282], [187678.006, 180294.916]]], 'spatialReference': {'wkid': 4326}}

requiring a manual change of all records in reading in files.

And Third I previously created a script which uses :

result=point_geometries_SEDF.SHAPE.geom.within(a_point.buffer(0.5))

which no longer works it appears the buffer function has been broken as using the within function on a point does not return an error only on a buffer

>>> start_point.within(start_point)
True

>>> start_point.within(start_point.buffer(1))

Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
start_point.within(start_point.buffer(1))
File "C:\Users\CIM_Laptop\AppData\Local\ESRI\conda\envs\arcgis1_5\lib\site-packages\arcgis\geometry\_types.py", line 2223, in within
return self.as_shapely.within(second_geometry)
File "C:\Users\CIM_Laptop\AppData\Local\ESRI\conda\envs\arcgis1_5\lib\site-packages\shapely\geometry\base.py", line 723, in within
return bool(self.impl['within'](self, other))
File "C:\Users\CIM_Laptop\AppData\Local\ESRI\conda\envs\arcgis1_5\lib\site-packages\shapely\predicates.py", line 13, in __call__
self._validate(other, stop_prepared=True)
File "C:\Users\CIM_Laptop\AppData\Local\ESRI\conda\envs\arcgis1_5\lib\site-packages\shapely\topology.py", line 18, in _validate
raise ValueError("Null geometry supports no operations")
ValueError: Null geometry supports no operations

0 Kudos
2 Replies
JoshuaBixby
MVP Esteemed Contributor

In terms of not being able to import ArcPy after applying the 2.3.1 patch, I haven't seen that come up as an issue.  I know for me importing ArcPy still works after the patch was installed.  I think it would be worth doing a clean install of Pro 2.3 and the 2.3.1 patch.  As much as reinstalling Pro might seem like a hassle, uninstalling and reinstalling Pro is much faster than ArcMap, and I have found over the years that the upfront hassle of reinstalling is usually quicker in the long run than trying to troubleshoot gremlins related to a messed up install.

0 Kudos
OisinSlevin
Occasional Contributor

I've got back to my previous installation, all is working, think I'm going to avoid the update button until I have the time to fight gremlins. 

0 Kudos