pysal / mgwr

Multiscale Geographically Weighted Regression (MGWR)
https://mgwr.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
366 stars 126 forks source link

Geopandas error after the installation of mgwr #53

Open emanuelemassaro opened 5 years ago

emanuelemassaro commented 5 years ago

I have installed the package mgwr trough anaconda. After the installation geopandas gives problems that was not giving before the installation of mgwr. This happens everytime that I try to install it

      5 import pandas as pd
      6 import seaborn as sns
----> 7 import geopandas as gpd
      8 import mgwr
      9 from mgwr.gwr import GWR

/anaconda3/lib/python3.6/site-packages/geopandas/__init__.py in <module>
      2 from geopandas.geodataframe import GeoDataFrame
      3 
----> 4 from geopandas.io.file import read_file
      5 from geopandas.io.sql import read_postgis
      6 from geopandas.tools import sjoin

/anaconda3/lib/python3.6/site-packages/geopandas/io/file.py in <module>
      1 import os
      2 
----> 3 import fiona
      4 import numpy as np
      5 import six

/anaconda3/lib/python3.6/site-packages/fiona/__init__.py in <module>
     81     os.environ["PATH"] = os.environ["PATH"] + ";" + libdir
     82 
---> 83 from fiona.collection import BytesCollection, Collection
     84 from fiona.drvsupport import supported_drivers
     85 from fiona.env import ensure_env_with_credentials, Env

/anaconda3/lib/python3.6/site-packages/fiona/collection.py in <module>
      7 
      8 from fiona import compat, vfs
----> 9 from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
     10 from fiona.ogrext import Session, WritingSession
     11 from fiona.ogrext import buffer_to_virtual_file, remove_virtual_file, GEOMETRY_TYPES

ImportError: dlopen(/anaconda3/lib/python3.6/site-packages/fiona/ogrext.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libfontconfig.1.dylib
  Referenced from: /anaconda3/lib/libpoppler.78.dylib
  Reason: Incompatible library version: libpoppler.78.dylib requires version 14.0.0 or later, but libfontconfig.1.dylib provides version 13.0.0
ljwolf commented 5 years ago

Sorry this happened! Can you please show:

  1. the exact command you used to install mgwr?
  2. the output of conda list?

@ocefpaf, I'm sorry to bug, but you're listed as the maintainer for this recipe, and I'm not sure if this is a mgwr-feedstock thing, or if this is part of the broader issue around strict channel preference?

ocefpaf commented 5 years ago

@emanuelemassaro please open an issue in the package feedstock if you are using conda-forge or AnacondaRecipes if you are using defaults.

Be sure you are following the recommendations in https://conda-forge.org/docs/user/tipsandtricks.html#how-to-fix-it and try:

conda create --name TEST python=3.6 geopandas
conda activate TEST
python -c "import geopandas; print(geopandas.__version__)"
0.5.0

Everything works for me on Linux. I see you are on macOS but my guess is that it is a channel mixing problem that will be solved if you follow the recommendation from our docs in the link above.

weikang9009 commented 5 years ago

Hi @emanuelemassaro @ocefpaf, I think the error is due to the fact that geopandas is a soft dependency for mgwr. In other words, we do not install geopandas on your local machine if you run conda intall mgwr or pip install mgwr. If you want to use some mgwr functions like compare_surfaces which requires geopandas, you will need to install geopandas additionally.