Path: csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'scripts': 0.03; 'configure': 0.05; 'importerror:': 0.07; 'dependency': 0.09; 'forcing': 0.09; 'lookup': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'referenced': 0.09; 'setup.py': 0.09; 'suggestions:': 0.09; 'python': 0.11; 'suggest': 0.14; '2):': 0.16; 'fine.': 0.16; 'macosx': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'skip:d 60': 0.16; 'subject:failed': 0.16; 'sure.': 0.16; 'unpack': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'library': 0.18; 'module': 0.19; 'trying': 0.19; 'seems': 0.21; 'example': 0.22; 'import': 0.22; 'install': 0.23; 'header:User-Agent:1': 0.23; '2.1': 0.24; "shouldn't": 0.24; 'subject: .': 0.24; 'paul': 0.24; "i've": 0.25; 'source': 0.25; 'skip:" 40': 0.26; 'least': 0.26; 'header:X-Complaints-To:1': 0.27; 'installed': 0.27; 'tried': 0.27; 'skip:p 30': 0.29; "i'm": 0.30; 'gcc': 0.31; 'python2.7': 0.31; 'struct': 0.31; 'file': 0.32; '(most': 0.33; 'skip:_ 10': 0.34; "can't": 0.35; 'but': 0.35; 'building': 0.35; 'there': 0.35; 'in:': 0.36; "didn't": 0.36; 'charset:us-ascii': 0.36; 'should': 0.36; 'too': 0.37; 'skip:- 20': 0.37; 'starting': 0.37; 'being': 0.38; 'expected': 0.38; 'problems': 0.38; 'to:addr :python-list': 0.38; 'files': 0.38; 'skip:- 10': 0.38; 'recent': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'received:org': 0.40; 'simple': 0.61; "you've": 0.63; 'refer': 0.63; 'choose': 0.64; 'smith': 0.68; 'containing': 0.69; 'export': 0.74; 'received:204': 0.75; 'article': 0.77; 'friends': 0.81; '*really*': 0.84; '4.2.1': 0.84; 'pycrypto': 0.84; 'received:204.14': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Deily Subject: Re: python 2.7.x on MacOSX: failed dlopen() on .so's Date: Wed, 13 Nov 2013 14:40:11 -0800 References: <1384370183.3496.472.camel@pdsdesk> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 204.14.154.233 User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 61 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1384382428 news.xs4all.nl 15940 [2001:888:2000:d::a6]:44732 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:59350 In article <1384370183.3496.472.camel@pdsdesk>, Paul Smith wrote: > I'm using MacOSX 10.7.5 with xcode 4.1, containing gcc 4.2.1 / clang 2.1 > (configure seems to choose gcc). > > I've tried this with both Python 2.7.5 and 2.7.6. I get the tarball, > unpack it, then: > > $ configure --prefix=/Users/build/python > $ make > $ make install > $ export PATH=/Users/build/python/bin:$PATH > $ export PYTHONHOME=/Users/build/python > $ python2.7 --version > Python 2.7.6 > > Simple scripts seem to work fine. But then I need to install various > packages; for example pycrypto. When I try to build that it fails to > build: > > $ cd src/pycrypto-2.6 && python2.7 setup.py build > Traceback (most recent call last): > File "setup.py", line 45, in > import struct > File "/Users/build/python/lib/python2.7/struct.py", line 1, in > from _struct import * > ImportError: > dlopen(/Users/build/python/lib/python2.7/lib-dynload/_struct.so, 2): Symbol > not found: _PyObject_Free > Referenced from: /Users/build/python/lib/python2.7/lib-dynload/_struct.so > Expected in: dynamic lookup > > This happens with every module that is not pure-Python: boto, paramiko, > etc. > > Looking at the various python2.7/lib-dynload/*.so files with nm I see > that actually a number of them refer to an unresolved ("U") symbol > _PyObject_Free (and other _PyObject_* symbols). I can't find any shared > library being built by the python build (.dylib or .so or whatever); > there's just a libpython2.7.a file (I tried forcing --enable-shared on > the configure line and it didn't change anything). There shouldn't be any problems with what you are trying to do. It works for me with Python 2.7.6 and pycrypto-2.6.1. Some suggestions: - Avoid --enable-shared on OS X at least initially. There are too many ways things can go wrong. If you've built with it, suggest starting with a fresh Python source directory just to be sure. - Check the dynamic library dependencies of _struct. On OS X: otool -L /Users/build/python/lib/python2.7/lib-dynload/_struct.so For a non-shared build, the only library dependency should be /usr/lib/libSystem.B.dylib. - Make sure you are *really* building pycrypto and friends with your Python and not with some other one. - On OS X with an installed Python, you shouldn't need to set PYTHONHOME. -- Ned Deily, nad@acm.org