Package compatability

Heads up! You've already completed this tutorial.

Wu_Yi | 2020-06-14 23:44:17 UTC | #1

I once tried to make a machine learning app with the scikit-learn package. I found something weird, if someone could help me to explain that would be great.

Basically, the fbs install seems to have problem of recognising this package, internet search seems to suggest that is because of this package is yet to be supported by pyinstaller https://github.com/pyinstaller/pyinstaller/wiki/Supported-Packages

So what is the way around this issue?


martin | 2020-06-15 08:52:04 UTC | #2

I don't think that is an exhaustive list so it not being on the list doesn't mean it won't work (it says at the top "most packages will work out of the box"). That said, scikit-learn uses Cython so could expect issues.

What kinds of errors did you get? Usually you can solve problems in PyInstaller using hooks e.g. https://pyinstaller.readthedocs.io/en/stable/hooks.html#understanding-pyinstaller-hooks

Packaging Python Applications with PyInstaller by Martin Fitzpatrick — This step-by-step guide walks you through packaging your own Python applications from simple examples to complete installers and signed executables.

More info Get the book

There is an example hook here which might do it.

from hookutils import collect_submodules hiddenimports = collect_submodules('sklearn')

Over 10,000 developers have bought Create GUI Applications with Python & Qt!
Create GUI Applications with Python & Qt6
Take a look

Downloadable ebook (PDF, ePub) & Complete Source code

Also available from Leanpub and Amazon Paperback

[[ discount.discount_pc ]]% OFF for the next [[ discount.duration ]] [[discount.description ]] with the code [[ discount.coupon_code ]]

Purchasing Power Parity

Developers in [[ country ]] get [[ discount.discount_pc ]]% OFF on all books & courses with code [[ discount.coupon_code ]]

Unfortunately, I don't think you can use custom PyInstaller hooks with fbs. You should be able to package with PyInstaller itself though.


PyQt/PySide 1:1 Coaching with Martin Fitzpatrick — Get one on one help with your Python GUI projects. Working together with you I'll identify issues and suggest fixes, from bugs and usability to architecture and maintainability.

Book Now 60 mins ($195)

Well done, you've finished this tutorial! Mark As Complete
[[ user.completed.length ]] completed [[ user.streak+1 ]] day streak
Martin Fitzpatrick

Package compatability was written by Martin Fitzpatrick .

Martin Fitzpatrick has been developing Python/Qt apps for 8 years. Building desktop applications to make data-analysis tools more user-friendly, Python was the obvious choice. Starting with Tk, later moving to wxWidgets and finally adopting PyQt. Martin founded PythonGUIs to provide easy to follow GUI programming tutorials to the Python community. He has written a number of popular Python books on the subject.