Eric Snow <ericsnowcurren...@gmail.com> added the comment:

When you run a Python script, the directory the script is in is automatically 
added to the beginning of sys.path.  This is the fundamental issue you've run 
into.

Basically, "src.common_object" is imported relative to the "src" that was 
imported relative to that automatically added sys.path entry.  However, 
"common_object" is a distinct module imported relative to the sys.path entry 
you explicitly added.

In general, adding a package's directory to sys.path is a bad idea.

----------
nosy: +eric.snow

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46806>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to