Python module import works for one file, fails for another
<p>I'm facing a very strange problem. I've got three files, the first contains the base class, from which the classes in the other two files inherit from.</p>

<p>The strange thing is, everything worked fine yesterday, but one of the files doesn't work anymore today. I haven't touched the imports in the meantime.</p>

<pre><code>.
└── orangecontrib
    ├──__init__.py
    └── prototypes
        ├──__init__.py
        └── widgets
            ├──__init__.py
            ├── owpythagorastree.py
            ├── owclassificationpythagorastree.py
            └── owregressionpythagorastree.py
</code></pre>

<p>So the classification and regression classes need to inherit from the base class, and the imports are done in the exact same way:</p>

<p><em>owclassificationpythagorastree.py</em></p>

<pre><code>...
from orangecontrib.prototypes.widgets.owpythagorastree import OWPythagorasTree
...
</code></pre>

<p><em>owregressionpythagorastree.py</em></p>

<pre><code>...
from orangecontrib.prototypes.widgets.owpythagorastree import OWPythagorasTree
...
</code></pre>

<p>Yet when I try to run the two scripts from the command line (with <code>python owregressionpythagorastree.py</code>) the regression widget works fine, but the classification widget produces the following error:</p>

<blockquote>
  <p>Traceback (most recent call last):   File
  "owclassificationpythagorastree.py", line 6, in 
      from orangecontrib.prototypes.widgets.owpythagorastree import OWPythagorasTree ImportError: No module named
  'orangecontrib.prototypes'</p>
</blockquote>

<p>This has happened several times in other projects as well, but it eventually sorts itself out. But it bothers me that I don't know what is causing this.</p>

<p>I did try running this both from my regular machine and a python virtualenv, where I have the module installed (I did this with <code>pip install -e .</code> in the base directory).</p>

<p>I see no apparent reason for this behaviour and it is bothering me a lot, so any help or insight as to why this is happening and how to fix it would be appreciated.</p>

<hr>

<p><strong>EDIT</strong></p>

<p>As requested, I ran <code>import sys; print(sys.path)</code> at the top of both scripts, and after running it through diff, they are both completely identical. Nevertheless, I am posting the results here.</p>

<blockquote>
  <p>['/home/pavlin/dev/orange3-prototypes/orangecontrib/prototypes/widgets',
  '/home/pavlin/dev/orange3',
  '/home/pavlin/dev/orange3env/lib/python3.5/site-packages/setuptools_git-1.1-py3.5.egg',
  '/home/pavlin/dev/orange-bio',
  '/home/pavlin/dev/orange3env/lib/python3.5/site-packages/pyqtgraph-0.9.10-py3.5.egg',
  '/home/pavlin/dev/orange3env/lib/python3.5/site-packages/requests-2.9.1-py3.5.egg',
  '/home/pavlin/dev/orange3env/lib/python3.5/site-packages/slumber-0.7.1-py3.5.egg',
  '/home/pavlin/dev/orange3env/lib/python3.5/site-packages/Genesis_PyAPI-1.2.0-py3.5.egg',
  '/usr/lib/python3.5/site-packages/qt_graph_helpers-0.1.3-py3.5-linux-x86_64.egg',
  '/home/pavlin/dev/orange3-prototypes',
  '/usr/lib/python3.5/site-packages',
  '/home/pavlin/dev/orange3env/lib/python35.zip',
  '/home/pavlin/dev/orange3env/lib/python3.5',
  '/home/pavlin/dev/orange3env/lib/python3.5/plat-linux',
  '/home/pavlin/dev/orange3env/lib/python3.5/lib-dynload',
  '/usr/lib64/python3.5', '/usr/lib/python3.5',
  '/usr/lib/python3.5/plat-linux',
  '/home/pavlin/dev/orange3env/lib/python3.5/site-packages',
  '/usr/lib/python3.5/site-packages/setuptools-18.7.1-py3.5.egg',
  '/home/pavlin/.local/lib/python3.5/site-packages']</p>
</blockquote>