deploying Envisage/PyQt4 application on Mac

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

deploying Envisage/PyQt4 application on Mac

Jonathan Blakes
Hello,

I have built an Envisage application on Ubuntu that uses the Qt backend
with Mayavi2 and PyTables but I am having trouble deploying it on Mac.

The main issue is how to fulfill the dependencies PyQt4, ETS, HDF5 and VTK.

On Linux I produce .deb and .yum packages using apt and alien to pull in
these as binaries from their respective repositories.

On Windows I can use Python(x,y) and then easy_install my code on top of
the supplied Python distribution.

On Mac I would like to use the Enthought Python Distribution (EPD) but
my test machine is OSX 10.4 Tiger and EPD only works for 10.5 - when I
tried EPD installed without complaint but typing 'python' gives a 'bus
error'.

If the end-user had OSX >= 10.5 then could they use EPD and supply PyQt4
independently (since it isn't listed in the EPD package list). Would the
Python distribution supplied by ETS work with a PyQt4 built via MacPorts?

I am currently trying to use MacPorts to bring in the above
dependencies, but qt4-mac is taking hours to build. Is there a binary
distribution of Qt4/PyQt4 for Mac? It seems ridiculous to expect the end
user to compile a complete Qt4 SDK just to run my code. (Btw, I have
looked at all the 'freezers' but I can't make any of them work with ETS
on any platform.)

Also, I couldn't see a traitsbackendqt MacPort package. If the MacPorts
method works could I just easy_install this on top of its Python?

If that works then does anyone know how to write/distribute a custom
Portfile meta-package that brings in all of the packages needed by
Mayavi (python-vtk, etc)?

Thank you for listening,

Jon.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Traits memory footprint

Giraudon Cyril
Hello,

I'm going to develop an application which handles a large graph of
objets. Traits / Traits UI seems to be a good choice for the
presentation layer. But should the graph itself contain Traits objects
or normal python objects (I know Traits has many interesting facilities
like events handling, default values, delegation, but this is not the
point here).

What is the memory footprint of Traits objects compare to normal python
objects for large graph ?

Thanks a lot,

Cyril.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Display a linklabel

Boiteux, Benoit
Hello,

How is it possible to display a linklabel in a view ?
For example, I created:
url = Str('http://www.google.com').

I tried to use an HyperlinkEditor with no success.

The purpose is to have a link an About box, and when you click the link, web browser starts and display your page.

Thanks
benoit
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] Traits memory footprint

bryce hendrix-2
In reply to this post by Giraudon Cyril
Giraudon Cyril wrote:

> Hello,
>
> I'm going to develop an application which handles a large graph of
> objets. Traits / Traits UI seems to be a good choice for the
> presentation layer. But should the graph itself contain Traits objects
> or normal python objects (I know Traits has many interesting facilities
> like events handling, default values, delegation, but this is not the
> point here).
>
> What is the memory footprint of Traits objects compare to normal python
> objects for large graph ?
>  

If using the null backend, it shouldn't be too bad, I would expect
somewhere in the 150% range, or less. However, if not using the null
backend, you've got all the wx or qt packages loaded into memory too.

bryce
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] Traits memory footprint

Robert Kern-2
On Wed, Jan 20, 2010 at 09:13, bryce hendrix <[hidden email]> wrote:

> Giraudon Cyril wrote:
>> Hello,
>>
>> I'm going to develop an application which handles a large graph of
>> objets. Traits / Traits UI seems to be a good choice for the
>> presentation layer. But should the graph itself contain Traits objects
>> or normal python objects (I know Traits has many interesting facilities
>> like events handling, default values, delegation, but this is not the
>> point here).
>>
>> What is the memory footprint of Traits objects compare to normal python
>> objects for large graph ?
>
> If using the null backend, it shouldn't be too bad, I would expect
> somewhere in the 150% range, or less. However, if not using the null
> backend, you've got all the wx or qt packages loaded into memory too.
He's asking about the overhead of HasTraits objects themselves, not
the Traits package.

HasTraits objects can be fairly efficient (there may be conditions
where they are not, but I suspect that you will not be using the
features that would cause this). Using __slots__ is the most
efficient, of course, but HasTraits objects come pretty close to the
memory footprint of __slots__. See the attached script. It uses the
PSI package to determine its own memory usage:

  http://psychofx.com/psi/

The end results:

[~]$ python memtest.py OldStyle | tail -1
  100000:  18316.0 kb
[~]$ python memtest.py Untraited | tail -1
  100000:  17508.0 kb
[~]$ python memtest.py Traited | tail -1
  100000:   4836.0 kb
[~]$ python memtest.py Slotted | tail -1
  100000:   3224.0 kb

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

memtest.py (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] Traits memory footprint

bryce hendrix-2
Robert Kern wrote:
On Wed, Jan 20, 2010 at 09:13, bryce hendrix [hidden email] wrote:
  
Giraudon Cyril wrote:
    
Hello,

I'm going to develop an application which handles a large graph of
objets. Traits / Traits UI seems to be a good choice for the
presentation layer. But should the graph itself contain Traits objects
or normal python objects (I know Traits has many interesting facilities
like events handling, default values, delegation, but this is not the
point here).

What is the memory footprint of Traits objects compare to normal python
objects for large graph ?
      
If using the null backend, it shouldn't be too bad, I would expect
somewhere in the 150% range, or less. However, if not using the null
backend, you've got all the wx or qt packages loaded into memory too.
    

He's asking about the overhead of HasTraits objects themselves, not
the Traits package.
  

Yes, I understood that part, but the memory impact of importing a backend cannot be ignored if you're aiming at a low threshold.

bryce

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] Traits memory footprint

Giraudon Cyril
Le 21/01/2010 00:30, bryce hendrix a écrit :
Robert Kern wrote:
On Wed, Jan 20, 2010 at 09:13, bryce hendrix [hidden email] wrote:
  
Giraudon Cyril wrote:
    
Hello,

I'm going to develop an application which handles a large graph of
objets. Traits / Traits UI seems to be a good choice for the
presentation layer. But should the graph itself contain Traits objects
or normal python objects (I know Traits has many interesting facilities
like events handling, default values, delegation, but this is not the
point here).

What is the memory footprint of Traits objects compare to normal python
objects for large graph ?
      
If using the null backend, it shouldn't be too bad, I would expect
somewhere in the 150% range, or less. However, if not using the null
backend, you've got all the wx or qt packages loaded into memory too.
    

He's asking about the overhead of HasTraits objects themselves, not
the Traits package.
  

Yes, I understood that part, but the memory impact of importing a backend cannot be ignored if you're aiming at a low threshold.

bryce
  
Thanks a lot for your help,

So if I understand correctly, the framework represents a non negligible cost, then the Traits graph objects is 1.5 times the weight of a normal objects graph.

If I decide to create an envisage application, there is no need to not use Traits objects for the graph, i.e. Traits do the job.

Regards,

Cyril.


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] Traits memory footprint

Lic. José M. Rodriguez Bacallao
is there any way to squeeze the memory footprint of Traits and
Envisage, in my application,  I am using only envisage for my plugins
system and the rest is my own pyqt code (I am not using workbench or
any other plugin except Core). I would like to use traits but I found
that using it, my memory footprint get high.

On 1/21/10, Giraudon Cyril <[hidden email]> wrote:

> Le 21/01/2010 00:30, bryce hendrix a écrit :
>> Robert Kern wrote:
>>> On Wed, Jan 20, 2010 at 09:13, bryce hendrix <[hidden email]>
>>> wrote:
>>>
>>>> Giraudon Cyril wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I'm going to develop an application which handles a large graph of
>>>>> objets. Traits / Traits UI seems to be a good choice for the
>>>>> presentation layer. But should the graph itself contain Traits objects
>>>>> or normal python objects (I know Traits has many interesting facilities
>>>>> like events handling, default values, delegation, but this is not the
>>>>> point here).
>>>>>
>>>>> What is the memory footprint of Traits objects compare to normal python
>>>>> objects for large graph ?
>>>>>
>>>> If using the null backend, it shouldn't be too bad, I would expect
>>>> somewhere in the 150% range, or less. However, if not using the null
>>>> backend, you've got all the wx or qt packages loaded into memory too.
>>>>
>>>
>>> He's asking about the overhead of HasTraits objects themselves, not
>>> the Traits package.
>>>
>>
>> Yes, I understood that part, but the memory impact of importing a
>> backend cannot be ignored if you're aiming at a low threshold.
>>
>> bryce
>>
> Thanks a lot for your help,
>
> So if I understand correctly, the framework represents a non negligible
> cost, then the Traits graph objects is 1.5 times the weight of a normal
> objects graph.
>
> If I decide to create an envisage application, there is no need to not
> use Traits objects for the graph, i.e. Traits do the job.
>
> Regards,
>
> Cyril.
>
>


--
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-----------------------------------------------------------------
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-----------------------------------------------------------------
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] Traits memory footprint

Robert Kern
In reply to this post by Giraudon Cyril
On Thu, Jan 21, 2010 at 04:14, Giraudon Cyril <[hidden email]> wrote:

> So if I understand correctly, the framework represents a non negligible
> cost, then the Traits graph objects is 1.5 times the weight of a normal
> objects graph.

Well, no. It takes about a quarter of the space of a normal objects
graph (i.e. Untraited). It takes about a third more space than a very
optimized, but inflexible, implementation (i.e. Slotted).

Of course, this benchmark may be missing some very important features
of your object graph. It is possible that you would want to use
WeakRef() traits to avoid reference counting cycles. That may take a
different amount of space. I highly recommend that you modify the
benchmark to compare classes that are at least a little more like the
classes that will be in your object graph. This shouldn't be too hard
since, if memory usage is a concern, the classes should be small and
lightweight anyways.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] Traits memory footprint

bryce hendrix-2
In reply to this post by Lic. José M. Rodriguez Bacallao
On 1/21/2010 9:07 AM, Lic. José M. Rodriguez Bacallao wrote:
> is there any way to squeeze the memory footprint of Traits and
> Envisage, in my application,  I am using only envisage for my plugins
> system and the rest is my own pyqt code (I am not using workbench or
> any other plugin except Core). I would like to use traits but I found
> that using it, my memory footprint get high.
>    

Not really. You can try to be careful about what gets imported, but
because you're using Envisage, pretty much all of ETS gets loaded. You
can try to set the ETS_TOOLKIT to 'null', but I don't know for certain
that something won't insist on a GUI backend.

Bryce


> On 1/21/10, Giraudon Cyril<[hidden email]>  wrote:
>    
>> Le 21/01/2010 00:30, bryce hendrix a écrit :
>>      
>>> Robert Kern wrote:
>>>        
>>>> On Wed, Jan 20, 2010 at 09:13, bryce hendrix<[hidden email]>
>>>> wrote:
>>>>
>>>>          
>>>>> Giraudon Cyril wrote:
>>>>>
>>>>>            
>>>>>> Hello,
>>>>>>
>>>>>> I'm going to develop an application which handles a large graph of
>>>>>> objets. Traits / Traits UI seems to be a good choice for the
>>>>>> presentation layer. But should the graph itself contain Traits objects
>>>>>> or normal python objects (I know Traits has many interesting facilities
>>>>>> like events handling, default values, delegation, but this is not the
>>>>>> point here).
>>>>>>
>>>>>> What is the memory footprint of Traits objects compare to normal python
>>>>>> objects for large graph ?
>>>>>>
>>>>>>              
>>>>> If using the null backend, it shouldn't be too bad, I would expect
>>>>> somewhere in the 150% range, or less. However, if not using the null
>>>>> backend, you've got all the wx or qt packages loaded into memory too.
>>>>>
>>>>>            
>>>> He's asking about the overhead of HasTraits objects themselves, not
>>>> the Traits package.
>>>>
>>>>          
>>> Yes, I understood that part, but the memory impact of importing a
>>> backend cannot be ignored if you're aiming at a low threshold.
>>>
>>> bryce
>>>
>>>        
>> Thanks a lot for your help,
>>
>> So if I understand correctly, the framework represents a non negligible
>> cost, then the Traits graph objects is 1.5 times the weight of a normal
>> objects graph.
>>
>> If I decide to create an envisage application, there is no need to not
>> use Traits objects for the graph, i.e. Traits do the job.
>>
>> Regards,
>>
>> Cyril.
>>
>>
>>      
>
>    

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] Traits memory footprint

Lic. José M. Rodriguez Bacallao
where do I set ETS_TOOLKIT to null?

On 1/22/10, Bryce Hendrix <[hidden email]> wrote:

> On 1/21/2010 9:07 AM, Lic. José M. Rodriguez Bacallao wrote:
>> is there any way to squeeze the memory footprint of Traits and
>> Envisage, in my application,  I am using only envisage for my plugins
>> system and the rest is my own pyqt code (I am not using workbench or
>> any other plugin except Core). I would like to use traits but I found
>> that using it, my memory footprint get high.
>>
>
> Not really. You can try to be careful about what gets imported, but
> because you're using Envisage, pretty much all of ETS gets loaded. You
> can try to set the ETS_TOOLKIT to 'null', but I don't know for certain
> that something won't insist on a GUI backend.
>
> Bryce
>
>
>> On 1/21/10, Giraudon Cyril<[hidden email]>  wrote:
>>
>>> Le 21/01/2010 00:30, bryce hendrix a écrit :
>>>
>>>> Robert Kern wrote:
>>>>
>>>>> On Wed, Jan 20, 2010 at 09:13, bryce hendrix<[hidden email]>
>>>>> wrote:
>>>>>
>>>>>
>>>>>> Giraudon Cyril wrote:
>>>>>>
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I'm going to develop an application which handles a large graph of
>>>>>>> objets. Traits / Traits UI seems to be a good choice for the
>>>>>>> presentation layer. But should the graph itself contain Traits
>>>>>>> objects
>>>>>>> or normal python objects (I know Traits has many interesting
>>>>>>> facilities
>>>>>>> like events handling, default values, delegation, but this is not the
>>>>>>> point here).
>>>>>>>
>>>>>>> What is the memory footprint of Traits objects compare to normal
>>>>>>> python
>>>>>>> objects for large graph ?
>>>>>>>
>>>>>>>
>>>>>> If using the null backend, it shouldn't be too bad, I would expect
>>>>>> somewhere in the 150% range, or less. However, if not using the null
>>>>>> backend, you've got all the wx or qt packages loaded into memory too.
>>>>>>
>>>>>>
>>>>> He's asking about the overhead of HasTraits objects themselves, not
>>>>> the Traits package.
>>>>>
>>>>>
>>>> Yes, I understood that part, but the memory impact of importing a
>>>> backend cannot be ignored if you're aiming at a low threshold.
>>>>
>>>> bryce
>>>>
>>>>
>>> Thanks a lot for your help,
>>>
>>> So if I understand correctly, the framework represents a non negligible
>>> cost, then the Traits graph objects is 1.5 times the weight of a normal
>>> objects graph.
>>>
>>> If I decide to create an envisage application, there is no need to not
>>> use Traits objects for the graph, i.e. Traits do the job.
>>>
>>> Regards,
>>>
>>> Cyril.
>>>
>>>
>>>
>>
>>
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev
>


--
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-----------------------------------------------------------------
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-----------------------------------------------------------------
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] Traits memory footprint

Peter Wang
On 1/22/10 9:52 AM, Lic. José M. Rodriguez Bacallao wrote:
> where do I set ETS_TOOLKIT to null?

You set it in your environment.  In Bash, for instance:

$ export ETS_TOOLKIT=null

-Peter
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Enthought-Dev] Traits memory footprint

Janet Swisher
On Fri, Jan 22, 2010 at 10:23 AM, Peter Wang <[hidden email]> wrote:
> On 1/22/10 9:52 AM, Lic. José M. Rodriguez Bacallao wrote:
>> where do I set ETS_TOOLKIT to null?
>
> You set it in your environment.  In Bash, for instance:
>
> $ export ETS_TOOLKIT=null

Actually, there are several ways to do it. You can set it
programmatically, so you don't have to rely on users setting an
environment variable.

http://code.enthought.com/projects/traits/docs/html/TUIUG/intro.html#id7

--Janet
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev