1

I am loading Geopandas into a Watson Studio Notebook.

!conda install --channel conda-forge geopandas geoplot geopy --yes

Output seems to indicate it works

!conda install --channel conda-forge geopandas geoplot geopy --yes

Solving environment: done

## Package Plan ##

  environment location: /opt/conda/envs/Python36

  added / updated specs: 
    - geopandas
    - geoplot
    - geopy


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------

    geopandas-0.5.0            |             py_3         891 KB  conda-forge
    
    ------------------------------------------------------------
                                           Total:       357.8 MB

The following NEW packages will be INSTALLED:


    geopandas:            0.5.0-py_3               conda-forge
    geoplot:              0.2.4-py_0               conda-forge
    geopy:                1.20.0-py_0              conda-forge


Downloading and Extracting Packages


geopandas-0.5.0      | 891 KB    | ##################################### | 100% 

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

But when I try to import it

import geopandas
from shapely.geometry import Point # Shapely for converting latitude/longtitude to geometry
from geopandas import GeoDataFrame
import geoplot
import geopy
import geoplot.crs as gcrs
import matplotlib.pyplot as plt
#from scipy import stats
import seaborn as sns
%matplotlib inline

I get


ModuleNotFoundError Traceback (most recent call last)

in

----> 1 import geopandas

ModuleNotFoundError: No module named 'geopandas'

And neither

!conda list

nor the Watson Studio Software configuration details shows that it was loaded. Same with geopy and geoplot.

Strange thing is this worked last week. Seems to be the same problem with Python 3.5.

I also tried loading Geopandas with pip but same results. It seems unlikely both the conda and pip scripts would be in error.

Can anyone suggest a way of investigating the cause. I have a case open with IBM but thought I would ask here as well. Thanks in advance.

Community
  • 1
  • 1
fleason
  • 11
  • 2

1 Answers1

0

From IBM Case

You need to create a custom environment to install the geopandas so that you don't need to install it explicitly.

channels: 
- defaults 
- conda-forge 
# Please add conda packages here 
dependencies: 
- geopandas=0.3.0 
- geoplot=0.2.3 
- pysal=1.14.4 
- folium=0.7.0 
- python=3.6.8 
# Please add pip packages here 
# To add pip packages, please comment out the next line 
#- pip:

and then you can use that custom environment for your notebook. Please see this:- https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/customize-envs.html?audience=wdp&context=wdp

fleason
  • 11
  • 2