Library loading error in an ipython notebook

(summarized/paraphrased based on a couple of questions I’ve gotten over email)

I’m running on el capitan and getting a failure when I try to run a MAF tutorial ipython notebook. The error message looks like
ImportError: dlopen(*/anaconda/opt/lsst/daf_persistence/python/lsst/daf/persistence/_persistenceLib.so, 10): Library not loaded: @rpath/libboost_system.dylib Referenced from: */anaconda/opt/lsst/boost/lib/libboost_filesystem.dylib Reason: image not found
or
ImportError: dlopen(*/lsst/DarwinX86/daf_persistence/w.2016.06/python/lsst/daf/persistence/_persistenceLib.so, 10): Library not loaded: libdaf_persistence.dylib Referenced from: */lsst/DarwinX86/daf_persistence/w.2016.06/python/lsst/daf/persistence/_persistenceLib.so Reason: image not found

Both of these errors are related to the fact that the DYLD_LIBRARY_PATH can be stripped when using an ipython notebook on el capitan, either with older versions of eups (pre 2.0.1) or with older versions of anaconda or if you use ‘ipython notebook’ instead of ‘jupyter notebook’.

The solution is to update anaconda and jupyter (I know ‘jupyter --version’ > 4.1.0 works), then start notebooks using jupyter notebook (not ipython notebook), and make sure you have a version of eups > 2.0.1.

Upgrading eups:
If you are using a conda installation of the stack, you can update eups by “conda upgrade eups”.
If you are using a source (eups distrib install) installation of the stack, the easiest way to upgrade eups is to reinstall the whole stack from scratch (rerun newinstall.sh). You can also upgrade eups by:

You can use git to upgrade eups as:
git clone git@github.com:RobertLuptonTheGood/eups
cd eups
./configure
make
make show
setup -r .
Pay attention to the make show output before you run make install.
(per @RHL, from How do we update EUPS?).

I’m surprised this works because I’ve just installed v4.1.2 and it still has this at the top:

#!/bin/bash /Users/timj/work/lsstsw/miniconda/bin/python.app
if __name__ == '__main__':
    import sys
    import IPython

    sys.exit(IPython.start_ipython())

which still strips DYLD_LIBRARY_PATH.

You have that at the top of “jupyter”?

Here’s what mine looks like: (OSX el capitan, version 4.1.0)

#!/Users/lynnej/anaconda/bin/python
"""Launch the root jupyter command"""

from jupyter_core.command import main

if __name__ == '__main__':
    main()

on the other hand, my ipython file is still:

#!/bin/bash /Users/lynnej/anaconda/bin/python.app
if __name__ == '__main__':
    import sys
    from IPython import start_ipython

    sys.exit(start_ipython()) 

… which is why ‘ipython notebook’ will NOT work, as mentioned above … although perhaps not with enough emphasis.).

You have to start notebooks using jupyter notebook, not ipython notebook.

Thank you. That explains it. Sorry for misreading. Yes, my jupyter is fine, it’s my ipython that has the broken shebang.

1 Like

Hi everyone,
The issue was also resolved upstream with the most-recent update to ipython conda package (version 4.1.2-py27_2). Run conda update ipython and loading of stack libraries should work again under El Capitan.

For more details, see:


Seems to be broken again in the newest release of ipython (4.2.0), so it’s back to using “jupyter” for notebooks.

Could you reopen https://github.com/conda/conda-build/issues/628 if this is the case? It’s quite a regression…

I can’t reopen that issue, but I did comment on it. Hopefully that means someone from conda will reopen it.

Filed a new issue: https://github.com/conda/conda-build/issues/1162

1 Like