Strange behavior of ClientCookie and site-packages
John J. Lee
jjl at pobox.com
Sat Sep 28 13:12:24 EDT 2002
On 19 Sep 2002, Brian Ibbotson wrote:
[...ClientCookie works from command line, but...]
> However, Idle for Python 2.2 cannot do the same. With an identical set
> of paths reported by sys.path, including the ClientCookie reference
> above, Idle reports:
>
> >>> import ClientCookie
> Traceback (most recent call last):
> File "<pyshell#0>", line 1, in ?
> import ClientCookie
> ImportError: No module named ClientCookie
> >>>
>
> Can anyone suggest an explanation for this behavior? Other third-party
> modules installed to site-packages (such as ChartDirector and MySQLdb)
> have had no problems once they are included in sys.path
That's odd. I don't use IDLE -- have you checked the IDLE docs for any
information about import peculiarities? All ClientCookie does, as you've
no doubt seen, is to import the 'public' names from various modules into
__init__.py, so that they can be imported using
from ClientCookie import foo
rather than
from ClientCookie._some_obscure_module import foo
So you may be able to work around the problem by doing the latter (look in
__init__.py to see what import statements you need).
Perhaps you'd have better luck asking directly about IDLE's behaviour in
this case. Let me know if it's something that can/should be fixed in
ClientCookie.
BTW, you'll have a much better chance of getting a prompt response from me
if you mail me questions about ClientCookie rather than (or in addition
to) posting them here -- I don't read c.l.py very often now.
John
More information about the Python-list
mailing list