Module Name Conflicts
peter at engcorp.com
Fri Aug 19 02:49:48 CEST 2005
torched_smurf at yahoo.com wrote:
> Robert Kern wrote:
>>That doesn't work. The first module is recorded as 'cmd' in sys.modules
>>and gets reused on the second import.
> Exactly. And clearing sys.modules doesn't fix the problem. Once it's
> imported something from the first cmd package, it can no longer find
> anything in another cmd package; it will always look for it in that
> first package.
That part isn't correct. Removing the entry from sys.modules should
(and has, for me, in the past) worked fine to let a second import reload
a module, or find a new module after sys.path has been tweaked. Try it
More information about the Python-list