Ok, now I'm getting a little further at least.
But is encounter a new error message, which I don’t understand:
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 129, in <module>
floating_point_exceptions = floating_point_exceptions()
File "/Users/magnus/Downloads/cctbx_sources/boost_adaptbx/boost/python.py", line 122, in floating_point_exceptions
import libtbx.load_env
File "/Users/magnus/Downloads/cctbx_sources/libtbx/load_env.py", line 5, in <module>
libtbx.env = libtbx.env_config.unpickle()
File "/Users/magnus/Downloads/cctbx_sources/libtbx/env_config.py", line 2194, in unpickle
set_preferred_sys_prefix_and_sys_executable(build_path=build_path)
File "/Users/magnus/Downloads/cctbx_sources/libtbx/env_config.py", line 2110, in set_preferred_sys_prefix_and_sys_executable
if (op.samefile(build_path, dirname)):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 162, in samefile
s1 = os.stat(f1)
OSError: [Errno 2] No such file or directory: ''
Somewhere it was suggested to launch by: python ./script.py instead of python script.py
but in my case, that didn't help
Suggestions how to proceed from here?
Thanks,
Magnus
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 <[email protected]> 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
[email protected]
http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________
cctbxbb mailing list
[email protected]
http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________
cctbxbb mailing list
[email protected]
http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________
cctbxbb mailing list
[email protected]
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
##################################################
_______________________________________________
cctbxbb mailing list
[email protected]http://phenix-online.org/mailman/listinfo/cctbxbb