Pyinstaller automatically includes unneeded modules
<p>I am trying to create a .exe from a very simple script that I have written. The script only include glob and pandas. But pyinstaller is including matplotlib,numpy,scipy,qt4,ipython, and a bunch of other stuff. The .exe won't run because there is an error with matplotlib, but I don't even need matplotlib. What am I doing wrong to make pyinstaller not recognize that only glob and pandas are needed?</p>

<p>I have manually excluded scipy,matplotlib,PyQt4,and iPython and the .exe is still 160mb!</p>

<p>P.S. I'm doing this in winpython with python 3.4. </p>

<p>Edit: 
With a little further testing I have narrowed this down to Pandas. Even a script that only consists of:</p>

<pre><code>import pandas
</code></pre>

<p>will create a dist folder that is 460MB or a single file .exe that is 182MB. What is the easiest way that I can find out which modules are being imported so that I can properly exclude all of them?</p>

<p>Edit2:
I have tried making a hook-pandas.py file that contains:</p>

<pre><code>excludedhooks=['scipy','matplotlib','PIL','cython','PyQt4','zmq']
</code></pre>

<p>The console output indicates that imports are being removed due to the hook file, but tons of files from these modules still end up in the dist folder.</p>

<p>I have also tried excluding these modules in the .spec file as well as in the console using --exclude-module but the files from those modules still show up.</p>