I have the Anaconda 3.5.5 build for Python on Windows 10 and was also getting excessively large executables using the Anaconda distribution.
I was able to correct this by doing the following:
First create a virtual environment (forums suggest virtualenv, but this gave me problems so instead I used venv)
python -m venv C:/Python/NewEnv
This creates a virtual environment inside C:/Python/NewEnv with base python, pip and setuptools
Next switch to the newly created environment
C:/Python/NewEnv/Scripts/activate
You'll know that the environment is different as your command prompt will be prefaced with your new environment name (NewEnv)
Install numpy first, then scipy, then pandas
pip install numpy==1.13.3
pip install scipy==1.1.0
pip install pandas==0.18.1
pip install pypiwin32==223
pip install pyinstaller==3.2
I had to use these versions as I've tried different ones, but any later version of pandas were giving me further issues.
Once these have been installed you can compile your program
C:/Python/NewEnv/Scripts/pyinstaller --onefile program.py
This will create a .spec file, which you'll need to modify with this version of pandas and pyinstaller to add hidden imports otherwise loading pandas from the executable will fail (Not sure if there's a pyinstaller command to just create the spec file, but if there is then rather do that - see ammendment#1)
There will be a hidden imports line inside the newly created .spec file:
hiddenimports=[],
Change this to add pandas._libs.tslibs.timedeltas
hiddenimports=['pandas._libs.tslibs.timedeltas'],
Then you can compile your program again against the .spec file
C:/Python/NewEnv/Scripts/pyinstaller --onefile program.spec
Note that this will install the program in whichever directory you are in so change directories before executing pyinstaller.
Ammendmend#1: I see that it's possible to add the hook-pandas.py to the Pyinstaller hooks.
So after you install pyinstaller in the new environment, run
echo hiddenimports = ['pandas._libs.tslibs.timedeltas'] > C:\Python\NewEnv\Lib\site-packages\PyInstaller\hooks\hook-pandas.py