These are chat archives for ipython/ipython

16th
Feb 2017
Andrew Milson
@andrewmilson
Feb 16 2017 16:12
I'm running into the same error this guy has https://gis.stackexchange.com/questions/72530/gdal-loads-in-python-but-not-ipython-linux. He says in his solution "creating a new script titled sqlite3.py, and populating it with raise ImportError". What does he mean by "populating it with raise ImportError"?
Albert Kottke
@arkottke
Feb 16 2017 17:06
@andrewmilson Did you figure this out? It looks like he is recommending a file with only raise ImportError
@andrewmilson This is a pretty crude solution. Are you using a Python distribution? How was GDAL installed?
Andrew Milson
@andrewmilson
Feb 16 2017 17:11
GDAL installed through apt
I put a "raise ImportError" in sqlite3.py
Albert Kottke
@arkottke
Feb 16 2017 17:12
and python installed via apt as well?
Andrew Milson
@andrewmilson
Feb 16 2017 17:12
When I put it in one of my sys.path directories it stopped IPython from starting
Albert Kottke
@arkottke
Feb 16 2017 17:13
The "solution" works because it makes GDAL load a specific version of sqlite, but it breaks other programs that try and load sqlite3
Andrew Milson
@andrewmilson
Feb 16 2017 17:14
both a conda and apt installation of python
Albert Kottke
@arkottke
Feb 16 2017 17:15
if you use a conda version of python, then you should be using a conda version of GDAL
Andrew Milson
@andrewmilson
Feb 16 2017 17:17
Ok, IPython using the conda python. I tried removing GDAL apt and instaling through conda but installation through conda didn't install dev packages for GDAL
Albert Kottke
@arkottke
Feb 16 2017 17:19
and you need the dev packages to compile against?
Andrew Milson
@andrewmilson
Feb 16 2017 17:25

@arkottke $ apt-get remove '^libgdal.*'
$ conda install gdal

The following NEW packages will be INSTALLED:

gdal:      2.1.0-py35_0            
geos:      3.5.0-0                 
geotiff:   1.4.1-0                 
hdf4:      4.2.12-0     conda-forge
kealib:    1.4.6-0                 
libgdal:   2.1.0-0                 
libnetcdf: 4.4.1-0      conda-forge
proj4:     4.9.2-0                 
xerces-c:  3.1.4-0 ```

Then in IPython libgdal.so.1: cannot open shared object file: No such file or directory

Albert Kottke
@arkottke
Feb 16 2017 17:30
@andrewmilson I can't check this, but conda should be putting libgdal.so.1 somewhere, but it might not be in your path
Andrew Milson
@andrewmilson
Feb 16 2017 17:49
@arkottke I created a symlink from /usr/lib/ogdi/libgdal.so to /usr/lib/libgdal.so.1. I am now getting errors with pdal in IPython "ImportError: /usr/lib/libpdal_base.so.4: symbol _ZNK19OGRSpatialReference14GetLinearUnitsEPPc, version GDAL_1.8 not defined in file libgdal.so.1 with link time reference"
Andrew Milson
@andrewmilson
Feb 16 2017 18:58
@arkottke problem solved. I wasn't removing all the apt gdal libraries. Properly removed apt packaged this time and installed gdal with conda. Thanks for your help!
Albert Kottke
@arkottke
Feb 16 2017 19:02
@andrewmilson Glad to hear you figured it out