durusmail: quixote-users: enable_ptl/easy_install problem
enable_ptl/easy_install problem
2007-04-30
2007-04-30
2007-04-30
2007-04-30
2007-05-01
2007-05-01
2007-05-01
2007-05-01
Re: enable_ptl/easy_install problem
2007-05-01
2007-05-01
2007-05-01
2007-05-01
Re: enable_ptl/easy_install problem - WORKING!
2007-05-02
enable_ptl/easy_install problem
Mike Orr
2007-05-01
On 4/30/07, Eddie Corns  wrote:
> $ python
> >>> from quixote import enable_ptl
> >>> enable_ptl()
> >>> import munepy
> Traceback (most recent call last):
>   File "", line 1, in ?
> ImportError: No module named munepy
> >>>
>
> versus
> $ python
> >>> import munepy
> >>>

You can make a utility script like this:

====
from quixote import enable_ptl
enable_ptl()
import first_ptl_module
import second_ptl_module
# Continue with all .ptl modules
====

If you run this every time you modify the .ptl's, it will update all
the .pyc's, and then you can avoid using enable_ptl() at all in your
application.

Import hooks are fragile in Python, and often break when combined with
import hooks from other packages.  That's why they must be enabled in
a certain order; e.g., PTL after ZODB.  I can't remember which other
packages have import hooks.  Cheetah has an optional one though I've
never used it.

--
Mike Orr 
reply