ydataai / ydata-profiling

1 Line of code data quality profiling & exploratory data analysis for Pandas and Spark DataFrames.
https://docs.profiling.ydata.ai
MIT License
12.57k stars 1.69k forks source link

Is it possible to convert a script with pandas_profiling to executable using pyinstaller? #706

Open ahmetbaglan opened 3 years ago

ahmetbaglan commented 3 years ago

Missing functionality

I have been writing a very simple tkinter application reading a csv and running pandas profiling. I couldn't convert my application to windows executable using pyinstaller. Is it possible for you to share .spec file which is working ? I have already tried to write mine without success. My intention is to share pandas_profiling withouth necessarily asking people to install python.

The spec that I tried is below. Here I include extra packages like zmq because the error I get seemed related. But frankly I am not sure if I am on the right track.

Thanks,

main spec

block_cipher = None

import sys ; sys.setrecursionlimit(sys.getrecursionlimit() * 5) import zmq

a = Analysis(['main.py'], pathex=['/venv/Lib/site-packages', 'C:\Working\git\rds_ui', '/venv/Lib/site-packages/zmq'], binaries=[], datas=[],

hiddenimports=[zmq.backend,zmq.backend.cython, zmq.backend.cffi, zmq.error, zmq.sugar, zmq.utils],

         hookspath=[],
         runtime_hooks=[],
         excludes=[],
         win_no_prefer_redirects=False,
         win_private_assemblies=False,
         cipher=block_cipher,
         noarchive=False)

pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

a.datas += Tree('./venv/Lib/site-packages/pandas_profiling', prefix='pandas_profiling') a.datas += Tree('./venv/Lib/site-packages/pandas_profiling/report/presentation/flavours/html/templates/', '.') a.datas += Tree('./venv/Lib/site-packages/pandas_profiling/visualisation/', '.') a.datas += Tree('./venv/Lib/site-packages/zmq', '.') exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, [], name='main', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, upx_exclude=[], runtime_tmpdir=None, console=True )

sbrugman commented 3 years ago

Which error are you getting? Which version are you using? Happy to support compatibility with pyinstaller if we discover the issue.

(related issues: https://github.com/pandas-profiling/pandas-profiling/pull/175 and https://github.com/pandas-profiling/pandas-profiling/issues/246)

ahmetbaglan commented 3 years ago

Thank you so much for such a quick reply. I would really appreciate your help. I don't know if there is anybody tried this earlier but I suspect it might be a general issue for different Python and pandas_profiling versions somehow. Is there any spec which worked before?

My application is just a simple tkinter so I am pasting the image of the error. It is working well when I run as normal python script.

My setup and error is as following:

My Python version: 3.6.5

My pandas_profiling version: 2.10.1

I was getting a bunch of different errors. I kept trying different specs. The latest I get (with the spec from above) is:

image

sbrugman commented 3 years ago

@ahmetbaglan pyzmq should not be dependency for this package. I'd recommend asking on stackoverflow (tag pyinstaller) to have higher chances of getting your question answered: https://stackoverflow.com/questions/tagged/pandas-profiling. Again, feel free to create a PR once you've found the solution.

kosky77 commented 1 year ago

Which error are you getting? Which version are you using? Happy to support compatibility with pyinstaller if we discover the issue.

(related issues: #175 and #246)

Hello, not OP but I'm having issues as well. At the moment I am using auto-py-to-exe to build an exe that automatically runs pandas-profiler but apparently I can't build the exe due to the error in the image below. This error appears in the console right before it shuts and I have no idea what to do, I've searched everywhere and tried every solution possible and still I couldn't figure it out. Any idea on what to do? I also tried using Python 3.7 and using cx_freeze instead of PyInstaller but I couldn't manage to get it working... errore_pandas_profiling