I'm trying to import geopandas but when import fiona I get an error, this issue comes now, a month a go it is works fine. I don't know whats going wrong. I added traceback, conda info and conda list it's could be helpful.
import geopandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/mmngreco/anaconda3/lib/python3.5/site-packages/geopandas/__init__.py", line 4, in <module>
from geopandas.io.file import read_file
File "/Users/mmngreco/anaconda3/lib/python3.5/site-packages/geopandas/io/file.py", line 3, in <module>
import fiona
File "/Users/mmngreco/anaconda3/lib/python3.5/site-packages/fiona/__init__.py", line 69, in <module>
from fiona.collection import Collection, BytesCollection, vsi_path
File "/Users/mmngreco/anaconda3/lib/python3.5/site-packages/fiona/collection.py", line 7, in <module>
from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
ImportError: dlopen(/Users/mmngreco/anaconda3/lib/python3.5/site-packages/fiona/ogrext.cpython-35m-darwin.so, 2): Library not loaded: @rpath/libpng16.16.dylib
Referenced from: /Users/mmngreco/anaconda3/lib/libgdal.20.dylib
Reason: Incompatible library version: libgdal.20.dylib requires version 41.0.0 or later, but libpng16.16.dylib provides version 39.0.0
Info:
mmngreco@mmngreco ~> conda info
Current conda install:
platform : osx-64
conda version : 4.1.12
conda-env version : 2.5.2
conda-build version : 0+unknown
python version : 3.5.2.final.0
requests version : 2.11.1
root environment : /Users/mmngreco/anaconda3 (writable)
default environment : /Users/mmngreco/anaconda3
envs directories : /Users/mmngreco/anaconda3/envs
package cache : /Users/mmngreco/anaconda3/pkgs
channel URLs : https://conda.anaconda.org/t/<TOKEN>/conda-forge/osx-64/
https://conda.anaconda.org/t/<TOKEN>/conda-forge/noarch/
https://repo.continuum.io/pkgs/free/osx-64/
https://repo.continuum.io/pkgs/free/noarch/
https://repo.continuum.io/pkgs/pro/osx-64/
https://repo.continuum.io/pkgs/pro/noarch/
config file : /Users/mmngreco/.condarc
offline mode : False
is foreign system : False
conda list
# packages in environment at /Users/mmngreco/anaconda3:
#
Using Anaconda API: https://api.anaconda.org
_license 1.1 py35_1
_nb_ext_conf 0.3.0 py35_0
alabaster 0.7.9 py35_0
anaconda-clean 1.0.0 py35_0
anaconda-client 1.5.1 py35_0
anaconda custom py35_0
anaconda-navigator 1.3.1 py35_0
anaconda-nb-extensions 1.0.0 py35_0 anaconda-nb-extensions
appnope 0.1.0 py35_0
appscript 1.0.1 py35_0
argcomplete 1.0.0 py35_1
astroid 1.4.7 py35_0
astropy 1.2.1 np111py35_0
babel 2.3.4 py35_0
backports 1.0 py35_0
beautifulsoup4 4.5.1 py35_0
bitarray 0.8.1 py35_0
blaze 0.10.1 py35_0
bokeh 0.12.2 py35_0
boto 2.42.0 py35_0
bottleneck 1.1.0 np111py35_0
cffi 1.7.0 py35_0
chest 0.2.3 py35_0
click 6.6 py35_0
click-plugins 1.0.3 py35_0
cligj 0.4.0 py35_0
cloudpickle 0.2.1 py35_0
clyent 1.2.2 py35_0
colorama 0.3.7 py35_0
conda-build 1.20.0 py35_0
conda 4.1.12 py35_0 conda-forge
conda-env 2.5.2 py35_0 conda-forge
descartes 1.0.2 py35_0 conda-forge
expat 2.1.0 2 conda-forge
fiona 1.7.0 np111py35_3 conda-forge
freexl 1.0.2 1 conda-forge
gdal 2.1.1 np111py35_4 conda-forge
geopandas 0.2.1 py35_1 conda-forge
geopy 1.10.0 py35_0 conda-forge
geos 3.4.2 2 conda-forge
giflib 5.1.4 0 conda-forge
hdf4 4.2.12 0 conda-forge
jasper 1.900.1 1 conda-forge
jpeg 9b 0 conda-forge
json-c 0.12 0 conda-forge
jupyter_contrib_core 0.3.0 py35_0 conda-forge
jupyter_contrib_nbextensions 0.2.1 py35_0 conda-forge
jupyter_nbextensions_configurator 0.2.2 py35_0 conda-forge
kealib 1.4.6 3 conda-forge
krb5 1.14.2 0 conda-forge
libdap4 3.18.0 4 conda-forge
libgfortran 3.0.0 0 conda-forge
libiconv 1.14 3 conda-forge
libpq 9.5.4 3 conda-forge
libspatialindex 1.8.5 1 conda-forge
libspatialite 4.3.0a 8 conda-forge
libtiff 4.0.6 6 conda-forge
openjpeg 2.1.2 1 conda-forge
pillow 3.2.0 py35_1 conda-forge
proj.4 4.9.3 0 conda-forge
psycopg2 2.6.2 py35_1 conda-forge
pysal 1.12.0 py35_0 conda-forge
rtree 0.8.2 py35_0 conda-forge
shapely 1.5.17 np111py35_0 conda-forge
conda-manager 0.3.1 py35_0
configobj 5.0.6 py35_0
contextlib2 0.5.3 py35_0
cryptography 1.5 py35_0
curl 7.49.0 1
cycler 0.10.0 py35_0
cython 0.24.1 py35_0
cytoolz 0.8.0 py35_0
dask 0.11.0 py35_0
datashape 0.5.2 py35_0
decorator 4.0.10 py35_0
dill 0.2.5 py35_0
docutils 0.12 py35_2
dynd-python 0.7.2 py35_0
entrypoints 0.2.2 py35_0
et_xmlfile 1.0.1 py35_0
fastcache 1.0.2 py35_1
filelock 2.0.6 py35_0
flask 0.11.1 py35_0
flask-cors 2.1.2 py35_0
freetype 2.5.5 1
geotiff 1.4.1 0
get_terminal_size 1.0.0 py35_0
gevent 1.1.2 py35_0
greenlet 0.4.10 py35_0
h5py 2.6.0 np111py35_2
hdf5 1.8.17 1
heapdict 1.0.0 py35_1
html5lib 0.999 py35_0
icu 54.1 0
idna 2.1 py35_0
imagesize 0.7.1 py35_0
inflection 0.3.1 py35_0
ipykernel 4.5.0 py35_0
ipython 5.1.0 py35_0
ipython_genutils 0.1.0 py35_0
ipywidgets 5.2.2 py35_0
itsdangerous 0.24 py35_0
jbig 2.1 0
jdcal 1.2 py35_1
jedi 0.9.0 py35_1
jinja2 2.8 py35_1
jsonschema 2.5.1 py35_0
jupyter 1.0.0 py35_3
jupyter_client 4.4.0 py35_0
jupyter_console 5.0.0 py35_0
jupyter_core 4.2.0 py35_0
lazy-object-proxy 1.2.1 py35_0
libdynd 0.7.2 0
libgdal 1.11.2 1
libnetcdf 4.4.1 0
libpng 1.6.22 0
libxml2 2.9.2 0
libxslt 1.1.28 2
llvmlite 0.13.0 py35_0
locket 0.2.0 py35_1
lxml 3.6.4 py35_0
markupsafe 0.23 py35_2
matplotlib 1.5.3 np111py35_0
mistune 0.7.3 py35_1
mkl 11.3.3 0
mkl-service 1.1.2 py35_2
mock 2.0.0 py35_0
more-itertools 2.2 py35_0
mpmath 0.19 py35_1
multipledispatch 0.4.8 py35_0
munch 2.0.4 py35_0
nb_anacondacloud 1.2.0 py35_0
nb_conda 2.0.0 py35_0
nb_conda_kernels 2.0.0 py35_0
nbconvert 4.2.0 py35_0
nbformat 4.1.0 py35_0
nbpresent 3.0.2 py35_0
networkx 1.11 py35_0
nltk 3.2.1 py35_0
nose 1.3.7 py35_1
notebook 4.2.3 py35_0
numba 0.28.1 np111py35_0
numexpr 2.6.1 np111py35_0
numpy 1.11.1 py35_0
odo 0.5.0 py35_1
openpyxl 2.3.2 py35_0
openssl 1.0.2j 0
pandas 0.18.1 np111py35_0
pandasql 0.7.3 py35_0
partd 0.3.6 py35_0
path.py 8.2.1 py35_0
pathlib2 2.1.0 py35_0
patsy 0.4.1 py35_0
pbr 1.10.0 py35_0
pep8 1.7.0 py35_0
pexpect 4.0.1 py35_0
pickleshare 0.7.4 py35_0
pip 8.1.2 py35_0
pkginfo 1.3.2 py35_0
ply 3.9 py35_0
postgresql 9.5.4 0
proj4 4.9.2 0
prompt_toolkit 1.0.3 py35_0
psutil 4.3.1 py35_0
ptyprocess 0.5.1 py35_0
py 1.4.31 py35_0
pyasn1 0.1.9 py35_0
pycosat 0.6.1 py35_1
pycparser 2.14 py35_1
pycrypto 2.6.1 py35_4
pycurl 7.43.0 py35_0
pyflakes 1.3.0 py35_0
pygments 2.1.3 py35_0
pylint 1.5.4 py35_1
pyopenssl 16.0.0 py35_0
pyparsing 2.1.4 py35_0
pyproj 1.9.5.1 py35_0
pyqt 5.6.0 py35_0
pytables 3.2.3.1 np111py35_0
pytest 2.9.2 py35_0
python 3.5.2 0
python-dateutil 2.5.3 py35_0
python.app 1.2 py35_4
pytz 2016.6.1 py35_0
pyyaml 3.12 py35_0
pyzmq 15.4.0 py35_0
qt 5.6.0 0
qtawesome 0.3.3 py35_0
qtconsole 4.2.1 py35_1
qtpy 1.1.2 py35_0
quandl 3.0.1 py35_0
readline 6.2 2
redis 3.2.0 0
redis-py 2.10.5 py35_0
requests 2.11.1 py35_0
rope 0.9.4 py35_1
ruamel_yaml 0.11.14 py35_0
scikit-image 0.12.3 np111py35_1
scikit-learn 0.17.1 np111py35_2
scipy 0.18.1 np111py35_0
seaborn 0.7.0 py35_0
setuptools 27.2.0 py35_0
simplegeneric 0.8.1 py35_1
singledispatch 3.4.0.3 py35_0
sip 4.18 py35_0
six 1.10.0 py35_0
snowballstemmer 1.2.1 py35_0
sockjs-tornado 1.0.3 py35_0
sphinx 1.4.6 py35_0
sphinx_rtd_theme 0.1.9 py35_0
spyder 3.0.0 py35_0
sqlalchemy 1.0.13 py35_0
sqlite 3.13.0 0
statsmodels 0.6.1 np111py35_1
sympy 1.0 py35_0
terminado 0.6 py35_0
theano 0.8.2 py35_0
tk 8.5.18 0
toolz 0.8.0 py35_0
tornado 4.4.1 py35_0
traitlets 4.3.0 py35_0
unicodecsv 0.14.1 py35_0
vincent 0.4.4 py35_0
wcwidth 0.1.7 py35_0
werkzeug 0.11.11 py35_0
wheel 0.29.0 py35_0
widgetsnbextension 1.2.6 py35_0
wrapt 1.10.6 py35_0
xerces-c 3.1.4 0
xlrd 1.0.0 py35_0
xlsxwriter 0.9.3 py35_0
xlwings 0.10.0 py35_0
xlwt 1.1.2 py35_0
xz 5.2.2 0
yaml 0.1.6 0
zeromq 4.1.3 0
zlib 1.2.8 3
This look like it is an issue with the conda repo having different software versions. Those binaries are not under the control of the Fiona project.
oh, thanks for that! :-)
Indeed this is unrelated to fiona. The problem is a package mismatch between anaconda default channel and conda-forge. 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. You can try:
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__)'
PS: Feel free to ask question in the geopandas/fiona feedstock about conda-forge packages.
https://github.com/conda-forge/fiona-feedstock
https://github.com/conda-forge/geopandas-feedstock
Cool, thanks ocefpaf, I already have conda-forge on top, but that would be very helpful, with a new env works well.
p.s. Sorry for close and reopen. Now, it is close the issue for me.
Most helpful comment
Indeed this is unrelated to
fiona. The problem is a package mismatch between anaconda default channel andconda-forge. Things should work properly if you addconda-forgeon top ofdefaultsin your.condarc, to take advantage of the channel preference feature of recentconda, and install things in an isolated env. You can try:PS: Feel free to ask question in the
geopandas/fionafeedstock about conda-forge packages.https://github.com/conda-forge/fiona-feedstock
https://github.com/conda-forge/geopandas-feedstock