On 6 Mar, 2011, at 13:11, André Sintzoff wrote:

> 2011/3/6 Ronald Oussoren <ronaldousso...@mac.com>:
>> 
>> On 4 Mar, 2011, at 17:10, Aahz wrote:
>> 
>>> On Fri, Mar 04, 2011, Andr? Sintzoff wrote:
>>>> 
>>>> The application is created with:
>>>> $ python setup.py py2app --use-pythonpath
>>>> 
>>>> Unfortunately, when
>>>> $ open ./dist/TortoiseHg.app/Contents/MacOS/TortoiseHg
>>>> the following message is displayed
>>>> ImportError: 
>>>> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/mercurial/osutil.so'
>>>> not found
>>>> 
>>>> I'm wondering why the application searches modules in
>>>> /System/Library/Frameworks/Python.framework and not in the bundle just
>>>> created where the files are available.
>>> 
>>> You need to download from python.org; using the built-in Python causes
>>> py2app to behave differently.
>> 
>> To be precise: py2app won't include the base install of Python in the 
>> appliction bundle when you use Apple's build of Python. This is make sure 
>> that you don't accidently ship parts of the OS in your application bundle 
>> (Python is open source, but it is better to be safe than sorry when lawyers 
>> can get involved).
>> 
>> What I don't understand is why it tries to load a part of mercurial from the 
>> stdlib, this definitely looks like a bug to me.  I wonder how mercurial got 
>> installed.
> 
> From source, using make local and make install which copies all files
> in /usr/local/lib/python2.5/site-packages/mercurial/
> 
> After copying 
> dist/TortoiseHg.app/Contents/Resources/lib/python2.5/lib-dynload/mercurial/*
> in 
> /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/mercurial
> the application fails a little bit further with:
> ImportError: 
> '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/PyQt4/QtCore.so'
> not found
> 
> So, the problem is perhaps not specific to mercurial itself.

It's most likely a bug in the way py2app bootstrap codes tries to locate the 
directory with extensions, it finds the system one instead of the one in the 
application bundle.  I don't have time to look into this right now, but should 
definitely have time at Pycon or the sprints afterwards.

Ronald

> 
> 
> André

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG

Reply via email to