[Tutor] Package loading

Karim karim.liateni at free.fr
Mon Nov 29 21:15:52 CET 2010


Hello every one,

I created a package with the following structure:

    * ops/
          o __init__.py
          o tcl/
                + __init__.py
                + pythontcl.py



 > *python -c "import sys; print sys.path; import ops.tcl.pythontcl"*

['', '/usr/local/lib/python2.6/dist-packages/pyparsing-1.5.5-py2.6.egg', 
'*/home/karim/build/UML2PDK/lib/python*', '/usr/lib/python2.6', 
'/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', 
'/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', 
'/usr/lib/python2.6/dist-packages', 
'/usr/lib/python2.6/dist-packages/PIL', 
'/usr/lib/python2.6/dist-packages/gst-0.10', 
'/usr/lib/pymodules/python2.6', 
'/usr/lib/python2.6/dist-packages/gtk-2.0', 
'/usr/lib/pymodules/python2.6/gtk-2.0', 
'/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode', 
'/usr/local/lib/python2.6/dist-packages']
/*home/karim/build/UML2PDK/lib/python/ops/tcl/pythontcl.py:109: 
RuntimeWarning: Parent module 'pythontcl' not found while handling 
absolute import
   import unittest
/home/karim/build/UML2PDK/lib/python/ops/tcl/pythontcl.py:110: 
RuntimeWarning: Parent module 'pythontcl' not found while handling 
absolute import
   import sys*

At the lines I import standard modules sys and unittest I get these 
non-sense warning (my consideration) though I added the top package 
root, namely, */home/karim/build/UML2PDK/lib/python. The programesecute 
correctly but I alaways get this nerving warning.

*Any idea will be welcome!* :-)

*Regards
Karim*
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20101129/babe6b8b/attachment.html>


More information about the Tutor mailing list