Installing Geopandas on Jupyter Notebook

6863
10
03-03-2020 06:59 AM
Status: Implemented
Labels (1)
TseringShawa
New Contributor II

Jupyter Notebook installed with ArcGIS Pro does not allow a person to install geopandas. I thought if I install Anaconda software separately that might allow me to installing geopandas but it does not. It seems geopandas can not be installed  using Jupyter Notebook if ArcGIS Pro is installed on the same computer. This means we can't teach both Arcpy and geopandas using the same computer. Can this problem be fixed? 

Thanks,

-Wangyal

10 Comments
MikeSweeney

Did you clone the the Python Package environment installed with ArcGIS Pro 2.5?

Make the clone active and then install GeoPandas?

You cannot modify the Python Package environment installed with Pro, you have to clone it and modify the clone.  That way you can always revert back to the original environment.

Python Package Manager—ArcPy Get Started | Documentation 

KoryKramer

There is a bug logged through Technical Support that may be related to the problem described here.

 

See BUG-000128147: GeoPandas module fails to install from ArcGIS Pro 2... 

For those finding this idea, it may be most effective to either go to the bug link and Subscribe if that is exactly the issue you're experiencing, or call Technical Support for assistance.

Thank you!

HannesZiegler

This is fixed as of ArcGIS Pro 2.8, geopandas can now be installed into an environment that also contains arcpy:

Steps to get geopandas installed (can be done through python package manager in ArcGIS Pro backstage backstage as well):

  • Clone arcgispro-py3 and activate clone
    • Using Python Command Prompt
      • conda create --clone arcgispro-py3 -n my_clone
      • proswap my_clone
    • Or use Python manage environments in ArcGIS Pro backstage
      • Manage Environments >> click Clone Default
      • Activate (toggle radio button) clone
      • Restart ArcGIS Pro (clone and re-open).
  • Install geopandas
    • Using Python Command Prompt
      • conda install geopandas -y
    • Or use Python package manager in ArcGIS Pro backstage
      • Install Packages tab >> search geopandas >> click Install
KoryKramer
Status changed to: Implemented
 
padu
by

padu_0-1649176747831.png

 I am trying to use the python package manager to install geopandas, I have already cloned my environment, when I click on the install, it runs but nothing happens. Any help with this ? 

@KoryKramer @MikeSweeney 

HannesZiegler

@padu Unfortunately this one keeps coming back to bite us, can you share what version of Pro you are using?

I just re-tested in Pro 2.9.0 (not patched) and it works there.

Update: Also just checked Pro 2.9.2 and it works there as well.

Thomas_Z2

@HannesZiegler 

I had the same issue today. Does not work with ArcGIS Pro 2.9.2 for me using the user interface.

It did work when using the Python Command Prompt (conda install geopandas) but I get warnings about an inconsistent environment.

 

(arcgispro-py3-dev) C:\Users\xyz\AppData\Local\ESRI\conda\envs\arcgispro-py3-dev>conda install geopandas
Collecting package metadata (current_repodata.json): done
Solving environment: |
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  - esri/win-64::arcgis==1.9.1=py37_2327
  - esri/win-64::arcpy==2.9=py37_arcgispro_32704
  - esri/win-64::cftime==1.5.0=py37_1
  - esri/win-64::gdal==3.3.0=arcgispro_py37_16778
  - esri/win-64::h5py==2.10.0=py37_arcgispro_12
  - esri/noarch::lerc==2.2=py_0
  - esri/win-64::matplotlib==3.4.2=py37_arcgispro_1
  - defaults/win-64::mkl-service==2.3.0=py37h196d8e1_0
  - defaults/win-64::mkl_fft==1.3.0=py37h46781fe_0
  - esri/win-64::mkl_random==1.2.0=py37_0
  - esri/win-64::netcdf4==1.5.7=py37_arcgispro_2
  - defaults/win-64::numexpr==2.7.3=py37hcbcaa1e_0
  - esri/win-64::numpy==1.20.1=py37_0
  - defaults/win-64::pandas==1.2.3=py37hf11a4ad_0
  - esri/noarch::saspy==3.7.8=py_0
  - defaults/win-64::scipy==1.6.2=py37h14eb087_0
  - defaults/win-64::shapely==1.7.1=py37h06580b3_0
  - esri/win-64::swat==1.9.3=py37_0
  - defaults/noarch::xarray==0.17.0=pyhd3eb1b0_0
failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\xyz\AppData\Local\ESRI\conda\envs\arcgispro-py3-dev

  added / updated specs:
    - geopandas

 

BTW It looks like Package Updates do also not work: Not sure it does something at all. There is no progress bar whatsoever. No error, nothing. Package (tried another one than geopandas) is not updated according to the list in the user interface. It still remains in the update list. Even after refreshing the list.

HannesZiegler

It seems package churn causes issues for geopandas.

The inconsistency warning differs slightly from mine in that line 23 is not present for me. Question: Are you working from a pristine environment cloned from the default (arcgispro-py3), or have you already installed one or more packages before attempting to install geopandas? What is the output of conda list?

Regarding updating packages from the backstage: This issue is logged in our que. To my understanding behavior was this: After clicking update package, double conda.exe processes run in task manager, but no feedback on update is provided to user on UI. After conda.exe process completes, UI remains the same, but checking conda list <pkg> does show the package updated. If there is any error during update,  package version won't have changed and it would appear nothing at all happened. 

Thomas_Z2

@HannesZiegler I may have installed other packages to (rkernel for Jupyter Notebook).

However, I just created (cloned) a pristine environment using the Python Command Prompt. I still get the inconsistency warning. I copied my steps and prompt output to a GitHub Gist:

https://gist.github.com/moosetraveller/d99daeb01cb53005ccece66e1b326896

HannesZiegler

We are aware that inconsistent environment warnings are now being thrown with arcgispro-py3 clones, these should be safe to ignore (https://github.com/conda/conda/issues/8490#issuecomment-481849564) and should not impact installing packages. On our next update to the base anaconda version we ship with arcgispro-py3 these warnings should go away.

In the case of geopandas, this package has a large dependency tree that is frequently not compatible with our environment (arcgispro-py3) pinning. In particular, we have had strict numpy and mkl pinning from Pro 2.6-3.0 to ensure performance across all CPU types. The difficulty with installing geopandas into arcgispro-py3 clones is that at any release of either, the dependencies may clash in just the right way to cause problems. Since becoming aware of this problem, there's always been an effort to iron out any conflicts before a new release, but for any given Pro release it is not possible to guarantee compatibility with future geopandas releases. At the time we previously closed the support issue around installing geopandas, the anaconda defaults copy of the geopandas package had a compatible dependency tree with our arcgispro-py3 environment. Currently in Pro 3.0 development we are seeing clones of arcgispro-py3 able to solve for geopandas=0.9.0 successfully as well.