geopandas with arcpy 10.7.1

2098
1
02-21-2020 12:04 PM
by Anonymous User
Not applicable

I recently upgraded my ArcGIS Desktop from 10.6.1 to 10.7.1 and I am having trouble finding a virtual environment that supports both 10.7.1 and open source GIS python libraries. I have a conda environment that works for 10.6.1 and open source, but when I try this environment with 10.7.1 it will not import geopandas or rasterio. I did a little digging and it seems this may have something to do with the different gdal bindings for 10.6.1 and 10.7.1. I noticed that when I remove the DTBGGP64.pth from the conda env, the geopandas and rasterio libraries work (arcpy does not though obviously). Has anyone encountered this? I am including the 10.6.1 conda environment yml file that worked great before I upgraded to 10.7.1.

After trying the 10.6.1 conda environment as-is, I created a new environment using the 10.7.1 library versions (pip.operations.freeze.freeze()) and adding the open source GIS libraries through conda. I copied the DTBGGP64.pth to the site packages folder of the new env. The problem is exactly the same. Arcpy functions work fine, but rasertio and geopandas give import errors. When I remove the DTBGGP64.pth, rasterio and geopandas work fine.

Edit: these are the specific errors I am getting.

with DTBGGP64

>>> import arcpy
>>> import rasterio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\envs\arcpy_10_7\lib\site-packages\rasterio\__init__.py", line 15, in <module>
    from rasterio._base import (
ImportError: DLL load failed: The specified procedure could not be found.

without DTBGGP64

>>> import rasterio
>>> import geopandas
>>> import arcpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named arcpy

0 Kudos
1 Reply
JimmyKnowles
Occasional Contributor II

I know it's been several months since your post, but maybe this will help you or others that are in a similar situation. I also had a need for rasterio which uses GDAL and ran into the same dll load failed error. Installing from wheels worked for me. I know it's not best practice to mix conda w/ pip, but I haven't experienced any issues.

I followed the instructions from the rasterio page rasterio · PyPI. Wheels can be found at Python Extension Packages for Windows - Christoph Gohlke.

Once rasterio and gdal were installed using the wheels, I was able to import both arcpy and rasterio without any issues. I haven't tried geopandas, but I imagine it would work since the problem seemed to be with gdal.

0 Kudos