[cctbxbb] Boost Import Error

Gabor Bunkoczi gb360 at cam.ac.uk
Wed Jun 4 06:01:22 PDT 2014


Hi Magnus,

> 
> but what is $DYLIB_LIBRARY_PATH?

Sorry, this should be DYLD_LIBRARY_PATH, as suggested by Luc's original 
answer below.

> 
>> It would probably be easier for you to rebuild the cctbx Python
>> bindings with the Python you want to use, and then all things would
>> work.
> 
> I think that's what I'm trying to do. I want to avoid the cctbx
> wrapper and therefore are launching python from my /opt/local/bin
> install where I keep all the rest of the modules I need. It is only
> cctbx that causes trouble. So I try to get "my" python to accept it.

Yeah, but this may not work if there is some binary incompatibility. So 
far it looks you are lucky, and it may. If not, you have to rebuild. 
This will not change "your" python in any way, i.e. other extensions 
remain functional.

Gabor

> 
> Thanks for you help in this matter - I appreciate it,
> 
> Magnus
> 
>> It only takes 10-20 minutes to compile even on a vintage computer.
>> 
>> BW, Gabor
>> 
>> On 2014-06-04 13:15, Magnus Andersson wrote:
>> Thanks Luc,
>> I have now updated by PYTHONPATH as you suggested:
>> export
>> 
> PYTHONPATH=/Users/magnus/Downloads/cctbx_sources:/opt/local/bin:/Users/magnus/Downloads/cctbx_build/lib:/Users/magnus/Downloads/cctbx_sources:/Users/magnus/Downloads/cctbx_sources/boost_adaptbx:/Users/magnus/Downloads/cctbx_sources/libtbx/pythonpath:/usr/local/lib
>> , which indeed makes my /opt/local/bin/python2.7 find boost.
>> However,
>> now I get a new error message, which is a little harder to
>> interpret:
>> import iotbx.pdb
>> File "/Users/magnus/Downloads/cctbx_sources/iotbx/pdb/__init__.py",
>> line 2, in <module>
>> from cctbx.array_family import flex
>> File
>> "/Users/magnus/Downloads/cctbx_sources/cctbx/array_family/flex.py",
>> line 2, in <module>
>> import scitbx.array_family.flex
>> File
>> "/Users/magnus/Downloads/cctbx_sources/scitbx/array_family/flex.py",
>> line 2, in <module>
>> import boost.optional # import dependency
>> File
>> 
> "/Users/magnus/Downloads/cctbx_sources/boost_adaptbx/boost/optional.py",
>> line 2, in <module>
>> import boost.python
>> File
>> 
> "/Users/magnus/Downloads/cctbx_sources/boost_adaptbx/boost/python.py",
>> line 57, in <module>
>> ext = import_ext("boost_python_meta_ext")
>> File
>> 
> "/Users/magnus/Downloads/cctbx_sources/boost_adaptbx/boost/python.py",
>> line 36, in import_ext
>> + [" "+p for p in sys.path]))
>> ImportError: __import__("boost_python_meta_ext"):
>> 
> dlopen(/Users/magnus/Downloads/cctbx_build/lib/boost_python_meta_ext.so,
>> 2): Symbol not found:
>> 
> boost::python::objects::function_object(boost::python::objects::py_function
>> const&, std::__1::pair<boost::python::detail::keyword const*,
>> boost::python::detail::keyword const*> const&)
>> Referenced from:
>> /Users/magnus/Downloads/cctbx_build/lib/boost_python_meta_ext.so
>> Expected in: /usr/local/lib/libboost_python.dylib
>> in /Users/magnus/Downloads/cctbx_build/lib/boost_python_meta_ext.so
>> sys.path:
>> /Users/magnus/Documents/TR-WAXS/magnus_testing/PyWAXS
>> /Users/magnus/.venvburrito/lib/python/distribute-0.6.32-py2.7.egg
>> /Users/magnus/.venvburrito/lib/python/virtualenv-1.8.4-py2.7.egg
>> 
> /Users/magnus/.venvburrito/lib/python/virtualenvwrapper-3.6-py2.7.egg
>> /Users/magnus/.venvburrito/lib/python/stevedore-0.8-py2.7.egg
>> 
> /Users/magnus/.venvburrito/lib/python/virtualenv_clone-0.2.4-py2.7.egg
>> /Users/magnus/.venvburrito/lib/python
>> /Users/magnus/Downloads/cctbx_sources
>> /opt/local/bin
>> /Users/magnus/Downloads/cctbx_build/lib
>> /Users/magnus/Downloads/cctbx_sources/boost_adaptbx
>> /Users/magnus/Downloads/cctbx_sources/libtbx/pythonpath
>> /usr/local/lib
>> 
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
>> 
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
>> 
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
>> 
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
>> 
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
>> 
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
>> 
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
>> 
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/readline
>> 
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
>> 
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
>> 
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyObjC
>> /Library/Python/2.7/site-packages
>> I don't know how to deal with this - any suggestions?
>> Thanks,
>> Magnus
>> On 03 Jun 2014, at 23:44, Luc Bourhis <luc_j_bourhis at mac.com> wrote:
>> Suggestions?
>> If you want to do it by hand, you need to parrot what cctbx.python
>> does. You need to set the following environment variables:
>> 1. LIBTBX_BUILD
>> that must be the path of cctbx_build next to cctbx_sources or
>> cctbx_project
>> 2. PYTHONPATH
>> at the very least it shall contain
>  
> $LIBTBX_BUILD/lib:$CCTBXSRC:$CCTBXSRC/boost_adaptbx:$CCTBXSRC/libtbx/pythonpath
> 
>> where $CCTBXSRC is the full path of cctbx_sources or cctbx_project
>> 3. DYLD_LIBRARY_PATH
>> It shall contain $LIBTBX_BUILD/lib
>> Best wishes,
>> Luc
>> _______________________________________________
>> cctbxbb mailing list
>> cctbxbb at phenix-online.org
>> http://phenix-online.org/mailman/listinfo/cctbxbb
>  _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb
> 
> _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb
> 
> 
> _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb

-- 
##################################################

      Dr Gabor Bunkoczi

      Cambridge Institute for Medical Research
      Wellcome Trust/MRC Building
      Addenbrooke's Hospital
      Hills Road
      Cambridge CB2 0XY
##################################################


More information about the cctbxbb mailing list