importing module from two packages with the same name

David Garamond davegaramond at icqmail.com
Sun Oct 6 05:01:01 EDT 2002


i have two modules in different location, but they belong to the same 
package name:

  /home/david/usr/lib/python/Package1/Libra.pm  (1)
  /home/david/proj/Proj1/lib/python/Package1/Scorpio.pm   (2)

i have added both paths to sys.path:

  import sys
  sys.path.insert(0, '/home/david/usr/lib/python')
  sys.path.insert(0, '/home/david/proj/Proj1/lib/python')

once python found Package1 in (1):

  import Package1.Libra

it won't search in (2), so i can't import Package1.Scorpio. any 
hint/trick to work around this? is this the intended python module 
search behaviour?

-- 
dave






More information about the Python-list mailing list