conda-forge / geopandas-feedstock

A conda-smithy repository for geopandas.
BSD 3-Clause "New" or "Revised" License
16 stars 14 forks source link

Cannot import GeoPandas to Jupyter Notebook #38

Closed yutingwum closed 6 years ago

yutingwum commented 6 years ago

Hi I installed GeoPandas and Fiona but cannot import to Jupyter Notebook. Does anyone know how to fix this? Any help is appreciated! Thanks!

Error message: wx20180607-1500022x

part of my package list. I am sure i have all the dependency fiona and geopands require. But I just cannot import Fiona and hence cannot import GeoPandas. image

jorisvandenbossche commented 6 years ago

@yutingwum Given the package list you show above, it seems that installed geopandas and its dependencies (eg Fiona) with pip? This is the issue tracker for the conda-forge package.

I would remove the packages with pip (so pip uninstall geopandas + also uninstall the dependencies), and then install them again with conda:

conda install geopandas
yutingwum commented 6 years ago

@jorisvandenbossche Thank you for the answer! What's the difference between pip and conda? Why is it causing this error?

I was reading somewhere else on github and someone mentioned "Things should work properly if you add conda-forge on top of defaults in your .condarc, to take advantage of the channel preference feature of recent conda, and install things in an isolated env" What does this mean?

conda config --add channels conda-forge --force  # Should add conda-forge on top of `defaults`.
conda create -n TEST -c conda-forge python=3.5 geopandas --yes
source activate TEST
python -c 'import geopandas; print(geopandas.__version__)'
jorisvandenbossche commented 6 years ago

See eg https://askubuntu.com/questions/574424/what-is-the-difference-between-pip-and-conda or https://stackoverflow.com/questions/20994716/what-is-the-difference-between-pip-and-conda

ocefpaf commented 6 years ago

See also this awesome post about these tools:

http://jakevdp.github.io/blog/2016/08/25/conda-myths-and-misconceptions/

yutingwum commented 6 years ago

@ocefpaf @jorisvandenbossche hi guys, thank you so much for the help. I pip uninstall GeoPandas and its dependencies and conda install them back. However, there is a new error that I cannot fix. Do you guys have any idea how I can fix it? Thank you so much!

image

jorisvandenbossche commented 6 years ago

I suppose you still have some left overs from installing it with pip.

Can you show the full output of 'conda list' ?

ocefpaf commented 6 years ago

@yutingwum you should use environments to, as is recommended in the docs, to isolate the packages from the system, conda root/base env, or anything from a previous pip installation.

Try this:

conda create --name GEOPANDAS python=3.6 geopandas
# if you have an older conda this next step should be
# `source activate GEOPANDAS` on bash-like shell and
# `activate GEOPANDAS` on Windows.
conda activate GEOPANDAS
python -c 'import fiona; print(fiona.__version__)'
1.7.11
yutingwum commented 6 years ago

Hi everyone, thank you very much for the help. @ocefpaf I tried what you suggested but still cannot import GeoPandas to Jupyter. @jorisvandenbossche below is my full conda list. Thank you!

bzip2                     1.0.6                h1de35cc_5  
ca-certificates           2018.03.07                    0  
cairo                     1.14.12              he60d9cb_2  
certifi                   2018.4.16                py36_0  
click                     6.7              py36hec950be_0  
click-plugins             1.0.3            py36hb58b8ed_0  
cligj                     0.4.0            py36h479156e_0  
curl                      7.60.0               ha441bb4_0  
cycler                    0.10.0           py36hfc81398_0  
descartes                 1.1.0            py36h2f9c1c0_0  
expat                     2.2.5                hb8e80ba_0  
fiona                     1.7.10           py36h6a33aa8_0  
fontconfig                2.12.6               h9850fc5_0  
freetype                  2.8                  h12048fb_1  
freexl                    1.0.5                h1de35cc_0  
geopandas                 0.3.0            py36h2f9c1c0_0  
geos                      3.6.2                h5470d99_2  
gettext                   0.19.8.1             h15daf44_3  
giflib                    5.1.4                h1035379_1  
glib                      2.56.1               h35bc53a_0  
hdf4                      4.2.13               h39711bb_2  
hdf5                      1.10.1               ha036c08_1  
icu                       58.2                 h4b95b61_1  
intel-openmp              2018.0.3                      0  
jpeg                      9b                   he5867d9_2  
json-c                    0.13.1               h3efe00b_0  
kealib                    1.4.7                hc1e10f3_5  
kiwisolver                1.0.1            py36h792292d_0  
libboost                  1.65.1               hcc95346_4  
libcurl                   7.60.0               hf30b1f0_0  
libcxx                    4.0.1                h579ed51_0  
libcxxabi                 4.0.1                hebd6815_0  
libdap4                   3.19.0               hefe82ba_2  
libedit                   3.1.20170329         hb402a30_2  
libffi                    3.2.1                h475c297_4  
libgdal                   2.2.4                h390fe88_1  
libgfortran               3.0.1                h93005f0_2  
libiconv                  1.15                 hdd342a3_7  
libkml                    1.3.0                hc0cae1e_3  
libnetcdf                 4.4.1.1              hdf03fd4_8  
libopenblas               0.2.20               hdc02c5d_7  
libpng                    1.6.34               he12f830_0  
libpq                     10.3                 hf30b1f0_0  
libspatialindex           1.8.5                h2c08c6b_2  
libspatialite             4.3.0a              h0a2fa02_18  
libssh2                   1.8.0                h322a93b_4  
libtiff                   4.0.9                hcb84e12_1  
libuuid                   1.0.3                h6bb4b03_2  
libxml2                   2.9.8                hab757c2_1  
matplotlib                2.2.2            py36ha7267d0_0  
mkl                       2018.0.3                      1  
munch                     2.3.2                    py36_0  
ncurses                   6.1                  h0a44026_0  
numpy                     1.14.3           py36he6379a5_2  
numpy-base                1.14.3           py36h7ef55bc_1  
openjpeg                  2.3.0                hb95cd4c_1  
openssl                   1.0.2o               h26aff7b_0  
pandas                    0.23.0           py36h1702cab_0  
pcre                      8.42                 h378b8a2_0  
pip                       10.0.1                   py36_0  
pixman                    0.34.0               hca0a616_3  
poppler                   0.65.0               he559eb3_0  
poppler-data              0.4.9                         0  
proj4                     4.9.3                h3f1bf9d_7  
psycopg2                  2.7.4            py36hdbc3d79_0  
pyparsing                 2.2.0            py36hb281f35_0  
pyproj                    1.9.5.1                  py36_0  
pysal                     1.14.3                   py36_0  
python                    3.6.5                hc167b69_1  
python-dateutil           2.7.3                    py36_0  
pytz                      2018.4                   py36_0  
readline                  7.0                  hc1231fa_4  
rtree                     0.8.3            py36h2f9c1c0_0  
scipy                     1.1.0            py36hcaad992_0  
setuptools                39.2.0                   py36_0  
shapely                   1.6.4            py36h2e8a847_0  
six                       1.11.0           py36h0e22d5e_1  
sqlalchemy                1.2.8            py36h1de35cc_0  
sqlite                    3.23.1               hf1716c9_0  
tk                        8.6.7                h35a86e2_3  
tornado                   5.0.2                    py36_0  
wheel                     0.31.1                   py36_0  
xerces-c                  3.2.1                h44e365a_0  
xz                        5.2.4                h1de35cc_4  
zlib                      1.2.11               hf3cbc9b_2 
ocefpaf commented 6 years ago

below is my full conda list.

There is not a single package from conda-forge there, they seems to be all from defaults. There is nothing we can do about that. We only build the conda-forge packages.