Python Forum
How to include pandas with pyinstaller - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How to include pandas with pyinstaller (/thread-24561.html)



How to include pandas with pyinstaller - Rickus - Feb-19-2020

Hello,

I am trying to build an exe with pyinstaller I a getting aModuleNotFoundError no module named 'pandas'

I have tried the following so far:

pyinstaller --hidden-import=pandas --onefile someapp.py

>pyinstaller someapp.py --onefile --hidden-import pandas


What is the proper syntax?

Thanks


RE: How to include pandas with pyinstaller - snippsat - Feb-19-2020

(Feb-19-2020, 06:18 PM)Rickus Wrote: What is the proper syntax?
Pyinstaller will find pandas,so it's just.
pyinstaller --onefile pan_prog.py
Theyhave fixed error i got here and fixed here.

If want to look at my test with virtual environment,so none of my previous stuff interfere.
C:\code
λ python -m venv pand_env

C:\code
λ cd pand_env\

C:\code\pand_env
λ C:\code\pand_env\Scripts\activate

(pand_env) C:\code\pand_env
λ pip install pyinstaller pandas
Collecting pyinstaller
  Downloading .......
Successfully installed altgraph-0.17 future-0.18.2 numpy-1.18.1 pandas-1.0.1 pefile-2019.4.18
pyinstaller-3.6 python-dateutil-2.8.1 pytz-2019.3 pywin32-ctypes-0.2.0 six-1.14.0

(pand_env) C:\code\pand_env
λ pyinstaller --onefile pan.py
68 INFO: PyInstaller: 3.6
69 INFO: Python: 3.7.2
70 INFO: Platform: Windows-10-10.0.18362-SP0
.....
27754 INFO: Building EXE from EXE-00.toc completed successfully.

(pand_env) C:\code\pand_env
λ cd dist

(pand_env) C:\code\pand_env\dist
λ ls
pan.exe*

(pand_env) C:\code\pand_env\dist
λ pan
       date     day  line  o:points   o:team  points  season  site   team  \
0  20110911  Sunday   2.0        12  Falcons      30    2011  home  Bears
1  20110918  Sunday   6.0        30   Saints      13    2011  away  Bears

   total  week
0   40.5     1
1   47.0     2