joblib.Parallel running through spyder hanging on Windows
<p>I'm running Python 3.5.1 on Windows Server 2013 at work. I have some embarrassingly parallel tasks that seem to work on Python 2.7 with basically the same code, but I am unable to figure out how to get it to run on Python 3.5.1. </p>

<p>I'm using Anaconda 2.4.1</p>

<p>The code looks like this... I've stripped it down to basically the minimum. </p>

<pre><code>\
-&gt;main.py
\apackage\
-&gt;__init__.py
-&gt;amodule.py
</code></pre>

<p>Code for <code>main.py</code></p>

<pre><code>from tpackage import AClass

def go():
    x = AClass().AFunction()
    return x
if __name__ == '__main__':
    x = go()
    print(x)
</code></pre>

<p>Code for <code>__init__.py</code></p>

<pre><code>from .amodule import AClass

__all__ = ['AClass']
</code></pre>

<p>Code for <code>amodule.py</code></p>

<pre><code>from joblib import Parallel, delayed

class AClass(object):
    def AFunction(self):
        x = Parallel(n_jobs=2,verbose=100)(
            delayed(add1)(i) for i in range(10)
            )
        return x

def add1(x):   
    return x + 1
</code></pre>

<p>Does this have anything to do with the need for a <code>if __name__ == '__main__':</code> statement? I didn't think I would need this because the <code>Parallel</code> is protected inside a <code>def</code> statement already and <em>should</em> only run when the <code>__main__</code> module is called, which should only happen once. </p>

<p>I should add that if I change <code>n_jobs=1</code> in <code>amodule.py</code>, everything works fine. </p>

<p><strong>Update:</strong></p>

<p>So after further review, it appears that this probably something to do with spyder. I'm using spyder 2.3.8. When I have spyder execute this is a dedicated window, it works. But when it runs in the interactive IPython console, it fails. I can also run the program directly from the command line without problems. </p>

<p><strong>Update 2:</strong></p>

<p>After further review, this really has to do with IPython being in a different working directory than the *.py file. Get those lined up and this works. </p>