Wednesday, July 4, 2018

[Python 3] Using Pandas with Pyinstaller

When compiling python code including pandas library, if we have errors on pandas library,
we should do the following:

1. Go to the directory below
  c:/~/Python3.6/Lib/site-package/PyInstaller/hooks

2. Make a file named 'hook-pandas.py' in case that there is no such file.
  The contents should be as below.

 hiddenimports = ['pandas._libs.tslibs.timedeltas',
                             'pandas._libs.tslibs.nattype',
                             'pandas._libs.tslibs.np_datetime',
                             'pandas._libs.skiplist']

3. Then, type the following command on the cmd to make a standalone application
  > pyinstaller -F --noconsole [filename]

1 comment:

  1. I am trying to convert a python file to exe using Anaconda Command promt. The code has pandas.. How to hook hidden imports in that case ?

    ReplyDelete