resolving module name conflicts.

Emile van Sebille emile at fenx.com
Fri Nov 11 16:31:03 EST 2011


On 11/11/2011 12:27 PM Gelonida N said...
>
>
> Hi,
>
> I got some code.
> - This code contains a package named tests
> - there are at least 100 references in different python files
> 	importing from above mentioned tests package.
> - the code also imports pytz at one place
>
> I get following warning message:
>
> /usr/lib/python2.6/dist-packages/pytz/__init__.py:32: UserWarning:
> Module tests was already imported from
> /home/user/myproject/tests/__init__.pyc, but
> /usr/lib/python2.6/dist-packages is being added to sys.path
>    from pkg_resources import resource_stream
>
>
> Is there any way to tell pytz to import it's own tests package and tell
> the rest of the code to import the other?
>
> Python version is 2.6.5
>
>
> Thanks in advance for any suggestion.

Start with 
http://docs.python.org/whatsnew/2.5.html#pep-328-absolute-and-relative-imports

Emile





More information about the Python-list mailing list