I am stuck trying to install gdal, running python3.6 on a Mac.
When I run
pip install gdal I get errors of
Failed building wheel for gdal error: command 'gcc' failed with exit status 1 Command "/Users/scottieb/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/1v/jks7f3sj1v772x048q qttmsw0000gn/T/pip-build-8hl9i7bl/gdal/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.c lose();exec(compile(code, __file__, 'exec'))" install --record /var/folders/1v/jks7f3sj1v772x048qqttmsw0000gn/T/pip-yvs4yb1x-record/ install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/1v/jks7f3sj1v772x 048qqttmsw0000gn/T/pip-build-8hl9i7bl/gdal/
I previously had a working version on mac, using this answer. But somehow, in trying to install osmnx, I screwed up my libraries and decided to uninstall anaconda and start afresh. On the latest install I am resetting up and can no longer use networkx to read shapefiles
import networkx as nx g = nx.read_shp('Road files/geo_export_4d537b7d-a470-4eb9-b147-1d0ea89e6b60.shp')
I tried to install gdal as before (
conda install gdal) but get the error:
UnsatisfiableError: The following specifications were found to be in conflict: - gdal -> numpy 1.8* -> python 2.6* -> openssl 1.0.1* - python 3.6*
Which I suspect means gdal is not currently supported for 3.6?
This is over my head currently, so I'm interested to learn where I went wrong and what exactly is going on to prevent me from retracing my steps here.
Cleaned up my path after advice from gene.
echo $PATH is now just
Even after running
conda install gdal, I can not read the shapefile. I'm getting the error
ImportError: dlopen(/Users/scottieb/anaconda/lib/python3.5/site-packages/osgeo/_gdal.so, 2): Library not loaded: @loader_path/./libgssapi_krb5.2.2.dylib Referenced from: /Users/scottieb/anaconda/lib/libgdal.20.dylib Reason: image not found
This is pretty common, and the normal solution is to install gdal. But I've already done that. Even though the install runs fine, I also can't import gdal while in python, a similar error about
libgdal.20.dylib. It looks like I have 2.0.0 for both gdal and libgdal, but it won't update (ie to 2.1.3, which it looks like gene has below).