[Pythonmac-SIG] py2app ZipImportError

2010-07-08 Thread Matti Lyra
I'm trying to package a small utility with py2app but am having some problems 
getting the .app to run. When I try to launch it it comes back with the 
following error:

ZipImportError: can't decompress data: zlib not available

I have installed python (2.6.4 - 64bit) from macports but this doesn't seem to 
be the problem as the same problem occurs when I switch to the System python 
(2.6.1 - 32bit).

I've confirmed that zlib.so is in the application bundle in 
Contents/Resources/lib/python2.6/lib-dynload

My py2app-devel is installed through macports as well, its version is 0.4.4

What's going on here, is the zlib.so somehow copied to the wrong place, or what?

I also tried to a simple hello world app with just a print line, same problem. 
If I  start the python interpreter from the command line I can import zlib 
without a problem.

-
Matti Lyra
matti.l...@gmail.com




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


[Pythonmac-SIG] uninstall python 2.7

2010-07-08 Thread Vincent Davis
Ok so my question is not only about python 2.7, and I don't
necessarily want to uninstall I just want to download the svn and
update. I do have numpy, scipy... and a few other things installed and
I will update them at the same time. I am writing a shell script to do
this so I was thinking that I could just completely remove py27 and
rebuild everything but is this necessary (the completely removing part
not the incremental updating :-)
I guess there is just a list of files to remove but I couldn't find a list.

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


Re: [Pythonmac-SIG] uninstall python 2.7

2010-07-08 Thread Ronald Oussoren

On 8 Jul, 2010, at 22:03, Vincent Davis wrote:

> Ok so my question is not only about python 2.7, and I don't
> necessarily want to uninstall I just want to download the svn and
> update. I do have numpy, scipy... and a few other things installed and
> I will update them at the same time. I am writing a shell script to do
> this so I was thinking that I could just completely remove py27 and
> rebuild everything but is this necessary (the completely removing part
> not the incremental updating :-)

Do you really mean to say you want to update from a 2.7 installation to a 2.7 
installation from the svn repo? In that case you don't have to removing the 
existing installation (or even upgrade site-packages), unless you change the 
architectures (switch to/from a universal build, or to a different kind of 
universal build)

If you upgrade from 2.6 to 2.7 you don't have to remove the 2.6 install, 2.6 
and 2.7 can be used side-by-side (both for unix and framework installs). 

> I guess there is just a list of files to remove but I couldn't find a list.

That depends on the type of install. For a framework install (python in 
/Library/Framework/Python.framework) you need to remove 
"/Library/Frameworks/Python.framework/Versions/2.7" and "/Applications/Python 
2.7". Depending on how you installed and with what options there may also be 
symlinks in /usr/local/bin.

Note that there are two binary installers for 2.7 on the website: one 
containing 32-bit binaries that work on OSX 10.3.9 or later and one containing 
ppc, i386 and x86_64 and works on OSX 10.5 and later.  The latter has two 
features that might cause surprises:  Tkinter doesn't work in 64-bit mode 
because the system version of Tk 8.4 doesn't support that and furthermore the 
readline extension is linked to libedit instead of the real readline. The 
latter means that the configuration for key-bindings uses a different syntax 
(see  for an example of why this is 
problematic).

Ronald
> 
> Thanks
> Vincent
> ___
> Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG



smime.p7s
Description: S/MIME cryptographic signature
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] uninstall python 2.7

2010-07-08 Thread Vincent Davis
On Thu, Jul 8, 2010 at 2:48 PM, Ronald Oussoren  wrote:
>
> On 8 Jul, 2010, at 22:03, Vincent Davis wrote:
>
>> Ok so my question is not only about python 2.7, and I don't
>> necessarily want to uninstall I just want to download the svn and
>> update. I do have numpy, scipy... and a few other things installed and
>> I will update them at the same time. I am writing a shell script to do
>> this so I was thinking that I could just completely remove py27 and
>> rebuild everything but is this necessary (the completely removing part
>> not the incremental updating :-)
>
> Do you really mean to say you want to update from a 2.7 installation to a 2.7 
> installation from the svn repo? In that case you don't have to removing the 
> existing installation (or even upgrade site-packages), unless you change the 
> architectures (switch to/from a universal build, or to a different kind of 
> universal build)
>
> If you upgrade from 2.6 to 2.7 you don't have to remove the 2.6 install, 2.6 
> and 2.7 can be used side-by-side (both for unix and framework installs).
>
>> I guess there is just a list of files to remove but I couldn't find a list.
>
> That depends on the type of install. For a framework install (python in 
> /Library/Framework/Python.framework) you need to remove 
> "/Library/Frameworks/Python.framework/Versions/2.7" and "/Applications/Python 
> 2.7". Depending on how you installed and with what options there may also be 
> symlinks in /usr/local/bin.

Yes I actually mean updating from 2.7 to 2.7 from svn.
I am running this install
./configure --with-universal-archs=64-bit
--enable-universalsdk=/Developer/SDKs/MacOSX10.5.sdk
--enable-framework
Are there other options I should consider? What I mean by that, are
there options you like or recommend. There is a lot I don't know about
./configure and the options.

It's not that I plan to do this often, but I want a shell script that
installs everything I want. I figure I need to right it down somewhere
it might has well be in a script. I plan to host this on github to
share with others.

Thanks for you help
Vincent

>
> Note that there are two binary installers for 2.7 on the website: one 
> containing 32-bit binaries that work on OSX 10.3.9 or later and one 
> containing ppc, i386 and x86_64 and works on OSX 10.5 and later.  The latter 
> has two features that might cause surprises:  Tkinter doesn't work in 64-bit 
> mode because the system version of Tk 8.4 doesn't support that and 
> furthermore the readline extension is linked to libedit instead of the real 
> readline. The latter means that the configuration for key-bindings uses a 
> different syntax (see  for an example of 
> why this is problematic).
>
> Ronald
>>
>> Thanks
>> Vincent
>> ___
>> Pythonmac-SIG maillist  -  pythonmac-...@python.org
>> http://mail.python.org/mailman/listinfo/pythonmac-sig
>> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
>
>
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


[Pythonmac-SIG] lists and accessors

2010-07-08 Thread Georg Seifert
Hi,

In my app I will access my cocoa data classes from a python script (run from 
within the app). This works fine, I can access all the methods and properties. 
For some of the array properties I use dedicated getter and setter 
(getItemAtIndex: , setItemAtIndex: ...).

I have a cocoa object:

@interface myObject : NSObject {
NSMutableArray *_items;
}
@property(retain) NSArray * items;
- (void) setItem:(id) Item atIndex: (int) Index;
- (id) itemAtIndex: (int) Index;
@end

Is it possible to access like:
object.items()[i]   # it would be even better to get rid of the 
parenthesis.
or
object.items.append(NewItem)

Calling from python should call the cocoa accessors instead of accessing the 
list directly. (I need to set some values and implemented undo in the 
accessors.)

My users are used to plain python scripting environments and don’t like the 
cocoa method names.

Is it somehow possible to tell python what accessors to use or is there a way 
to supply python wrappers? Or could I build a bridgesupport file?

Many Thanks
Georg
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] uninstall python 2.7

2010-07-08 Thread Ronald Oussoren

On 8 Jul, 2010, at 22:57, Vincent Davis wrote:

> On Thu, Jul 8, 2010 at 2:48 PM, Ronald Oussoren  
> wrote:
>> 
>> On 8 Jul, 2010, at 22:03, Vincent Davis wrote:
>> 
>>> Ok so my question is not only about python 2.7, and I don't
>>> necessarily want to uninstall I just want to download the svn and
>>> update. I do have numpy, scipy... and a few other things installed and
>>> I will update them at the same time. I am writing a shell script to do
>>> this so I was thinking that I could just completely remove py27 and
>>> rebuild everything but is this necessary (the completely removing part
>>> not the incremental updating :-)
>> 
>> Do you really mean to say you want to update from a 2.7 installation to a 
>> 2.7 installation from the svn repo? In that case you don't have to removing 
>> the existing installation (or even upgrade site-packages), unless you change 
>> the architectures (switch to/from a universal build, or to a different kind 
>> of universal build)
>> 
>> If you upgrade from 2.6 to 2.7 you don't have to remove the 2.6 install, 2.6 
>> and 2.7 can be used side-by-side (both for unix and framework installs).
>> 
>>> I guess there is just a list of files to remove but I couldn't find a list.
>> 
>> That depends on the type of install. For a framework install (python in 
>> /Library/Framework/Python.framework) you need to remove 
>> "/Library/Frameworks/Python.framework/Versions/2.7" and 
>> "/Applications/Python 2.7". Depending on how you installed and with what 
>> options there may also be symlinks in /usr/local/bin.
> 
> Yes I actually mean updating from 2.7 to 2.7 from svn.
> I am running this install
> ./configure --with-universal-archs=64-bit
> --enable-universalsdk=/Developer/SDKs/MacOSX10.5.sdk
> --enable-framework
> Are there other options I should consider? What I mean by that, are
> there options you like or recommend. There is a lot I don't know about
> ./configure and the options.

The configure flags look fine, although I on't use the 64-bit option myself. I 
use '--with-universal-archs=3-way --enable-universalsdk=/'.  That one is usable 
on all systems running 10.5 or later, but doesn't support 64-bit code on PPC. 

Do you use ctypes? I'm pretty sure there are bugs in libffi for darwin/ppc64, 
although I don't know if these affect ctypes. I don't support ppc64 in PyObjC 
because libffi caused exception handling there (at least the last time I tried 
running on such a system).

Another option that might be useful when you're experimenting is 
'--with-framework-name=NAME'. That allows you to rename 'Python.framework' to 
something else, which allows you to test if a new checkout results in a 
workable installation before you upgrade the real install.

> 
> It's not that I plan to do this often, but I want a shell script that
> installs everything I want. I figure I need to right it down somewhere
> it might has well be in a script. I plan to host this on github to
> share with others.

I have a script that builds a lot of frameworks here: 
.
 The script builds debug builds of python for a number of architectures and 
python versions. 

Ronald

smime.p7s
Description: S/MIME cryptographic signature
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] uninstall python 2.7

2010-07-08 Thread Vincent Davis
On Thu, Jul 8, 2010 at 3:06 PM, Ronald Oussoren  wrote:
>
> On 8 Jul, 2010, at 22:57, Vincent Davis wrote:
>
>> On Thu, Jul 8, 2010 at 2:48 PM, Ronald Oussoren  
>> wrote:
>>>
>>> On 8 Jul, 2010, at 22:03, Vincent Davis wrote:
>>>
 Ok so my question is not only about python 2.7, and I don't
 necessarily want to uninstall I just want to download the svn and
 update. I do have numpy, scipy... and a few other things installed and
 I will update them at the same time. I am writing a shell script to do
 this so I was thinking that I could just completely remove py27 and
 rebuild everything but is this necessary (the completely removing part
 not the incremental updating :-)
>>>
>>> Do you really mean to say you want to update from a 2.7 installation to a 
>>> 2.7 installation from the svn repo? In that case you don't have to removing 
>>> the existing installation (or even upgrade site-packages), unless you 
>>> change the architectures (switch to/from a universal build, or to a 
>>> different kind of universal build)
>>>
>>> If you upgrade from 2.6 to 2.7 you don't have to remove the 2.6 install, 
>>> 2.6 and 2.7 can be used side-by-side (both for unix and framework installs).
>>>
 I guess there is just a list of files to remove but I couldn't find a list.
>>>
>>> That depends on the type of install. For a framework install (python in 
>>> /Library/Framework/Python.framework) you need to remove 
>>> "/Library/Frameworks/Python.framework/Versions/2.7" and 
>>> "/Applications/Python 2.7". Depending on how you installed and with what 
>>> options there may also be symlinks in /usr/local/bin.
>>
>> Yes I actually mean updating from 2.7 to 2.7 from svn.
>> I am running this install
>> ./configure --with-universal-archs=64-bit
>> --enable-universalsdk=/Developer/SDKs/MacOSX10.5.sdk
>> --enable-framework
>> Are there other options I should consider? What I mean by that, are
>> there options you like or recommend. There is a lot I don't know about
>> ./configure and the options.
>
> The configure flags look fine, although I on't use the 64-bit option myself. 
> I use '--with-universal-archs=3-way --enable-universalsdk=/'.  That one is 
> usable on all systems running 10.5 or later, but doesn't support 64-bit code 
> on PPC.
>
> Do you use ctypes? I'm pretty sure there are bugs in libffi for darwin/ppc64, 
> although I don't know if these affect ctypes. I don't support ppc64 in PyObjC 
> because libffi caused exception handling there (at least the last time I 
> tried running on such a system).
>
> Another option that might be useful when you're experimenting is 
> '--with-framework-name=NAME'. That allows you to rename 'Python.framework' to 
> something else, which allows you to test if a new checkout results in a 
> workable installation before you upgrade the real install.
>
>>
>> It's not that I plan to do this often, but I want a shell script that
>> installs everything I want. I figure I need to right it down somewhere
>> it might has well be in a script. I plan to host this on github to
>> share with others.
>
> I have a script that builds a lot of frameworks here: 
> .
>  The script builds debug builds of python for a number of architectures and 
> python versions.

Thanks again I will have a look at you scripts. I ran make test and
got two errors, maybe these are documented, I am not really sure.
2 tests failed:
test_ctypes test_site

Thanks
Vincent

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


Re: [Pythonmac-SIG] lists and accessors

2010-07-08 Thread Ronald Oussoren

On 8 Jul, 2010, at 23:00, Georg Seifert wrote:

> Hi,
> 
> In my app I will access my cocoa data classes from a python script (run from 
> within the app). This works fine, I can access all the methods and 
> properties. For some of the array properties I use dedicated getter and 
> setter (getItemAtIndex: , setItemAtIndex: ...).
> 
> I have a cocoa object:
> 
> @interface myObject : NSObject {
>   NSMutableArray *_items;
> }
> @property(retain) NSArray * items;
> - (void) setItem:(id) Item atIndex: (int) Index;
> - (id) itemAtIndex: (int) Index;
> @end
> 
> Is it possible to access like:
>   object.items()[i]   # it would be even better to get rid of the 
> parenthesis.
> or
>   object.items.append(NewItem)
> 
> Calling from python should call the cocoa accessors instead of accessing the 
> list directly. (I need to set some values and implemented undo in the 
> accessors.)
> 
> My users are used to plain python scripting environments and don’t like the 
> cocoa method names.
> 
> Is it somehow possible to tell python what accessors to use or is there a way 
> to supply python wrappers? Or could I build a bridgesupport file?

Not easily. I've implemented code for the upcoming 2.3 release of pyobjc that 
will generate the accessors for you when you create a property in Python, but 
haven't gotten around to implementing the other direction.

Something that likely works (but I haven't tested this):

   class ItemProxy (object):
   def __init__(self, owner):
   self._ower = owner

   def __getitem__(self, i):
  return self.itemAtIndex_(i)

   ...

   del myClass.__dict__['items']
   myClass.__dict__['items'] = lambda self: ItemProxy(self)

A future version of PyObjC will allow you to configure ObjC properties in 
native classes using bridgesupport files and/or function in the objc module.

Ronald

P.S. I want to release PyObjC 2.3 this saturday, but need to squash a couple of 
bugs in the 64-bit support before I do the release.

P.P.S. The major feature in PyObjC 2.3 is support for Python 3. 

smime.p7s
Description: S/MIME cryptographic signature
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG