Python - Script throws error when executed in one folder. But not when executed in another
<p>Whenever I execute the following script: 
<a href="https://bitbucket.org/pedro_stanaka/flock-log-parser/src/1340cdb7f873f158d3778aec445e4e37ee5f2a32/main.py?fileviewer=file-view-default" rel="nofollow">https://bitbucket.org/pedro_stanaka/flock-log-parser/src/1340cdb7f873f158d3778aec445e4e37ee5f2a32/main.py?fileviewer=file-view-default</a></p>

<p>Inside its original folder (as it is in the project) i get the following error: </p>

<pre><code>Traceback (most recent call last):
   File "main.py", line 7, in &lt;module&gt;
   from matplotlib.backends.backend_pdf import PdfPages
[...] 
File "/usr/lib/python3.4/unittest/case.py", line 253, in &lt;module&gt;
class _CapturingHandler(logging.Handler):
AttributeError: 'module' object has no attribute 'Handler'
</code></pre>

<p>But when I copied the script (and <strong>JUST</strong> the script) to another folder in my computer and ran it using the same command line it worked.</p>

<pre><code>    python3.4 main.py
</code></pre>

<p>Why is this happening? Is there any explanation at all for this behavior?
I would like very much to keep the same folder/project.</p>

<p>I've tried to set PYTHONPATH and it did not work as well.</p>