[Pythonmac-SIG] py2app doesn't work with virtualenv on Leopard

Gary Bernhardt gary.bernhardt at gmail.com
Fri Oct 31 21:22:18 CET 2008


On Fri, Oct 31, 2008 at 2:15 PM, Christopher Barker
<Chris.Barker at noaa.gov> wrote:
> Gary Bernhardt wrote:
>>
>> I can't seem to get py2app to build an app in a virtualenv on Leopard.
>>  I find
>> it hard to believe that py2app doesn't work with virtualenv,
>
> Why? it was written before virtualenv existed, and I don't know that anyone
> has tested it with before -- I"d like to be able to do it, though, so thanks
> for trying!

It just seems like people *must* be doing this. The idea of writing a
non-trivial Python app in 2008 without virtualenv is unthinkable for
me! I know Ronald has contributed to virtualenv, so clearly at least
one person used it on the Mac at one point.

>>    raise ValueError('%r does not exist' % (pathname,))
>> ValueError: '/Users/grb/py2app-test/env/bin/../lib/libpython2.5.dylib'
>> does not exist
>
> It looks like py2app is looking for the main python lib inside your
> virtualenv location, when it should be looking in the main python location.
>
> I don't know how py2app decides where to look, but it looks like it's
> expecting it to be somewhere relative to the bin directory. You may be able
> to fake it out by putting a bunch of extra symlinks in your virtual env, but
> clearly, py2app should figure out where to look in a different place.

There's no .dylib in the system Python install, but if I copy
libpython2.5.a to where py2app wants the .dylib to be, it will build
an app. The resulting app fails at startup, though, with "ImportError:
No module named dist". That error seems to come from within distutils
itself (and yields no Google results).

I've coaxed py2app into failing in many different ways with various
combinations of virtualenv, workingenv and custom PYTHONPATH-managing
scripts, but I didn't want to subject the list to the full details. :)

I'd really like to know if anyone has made py2app work in *any*
capacity with virtualenv, workingenv, etc. on Leopard. At this point
I'd even be happy with some way to stick my libs in a directory and
munge PYTHONPATH to load them, but even that doesn't seem to work!

> Sorry I can't be more helpful.

Every little bit helps. :)

-- 
Gary
http://blog.extracheese.org


More information about the Pythonmac-SIG mailing list