I have a python project that contains multiple python scripts (5), as well as a database.ini file and a folder within, are the images. I looked around on StackOverflow and google to find any way that could allow me to convert this whole project to a folder that contains the dependencies and an executable but I can't find anything that fits what I want to do.
Even though python may not be a good choice to make an "app", I can't do it in another way and I really need to be able to share this project with someone else without him having to install python or any dependencies by himself.
I found that pyinstaller could do it but when I tried, not only I get an error when starting the executable but also, it doesn't read my requirements.txt file and installs a hundred useless python libs.
[EDIT] : I created a virtualenv in the folder that I want to convert and I activated it. Then I installed only the libs that I needed and I ran this command (in the venv) : pyinstaller --noconfirm --onedir --windowed --add-data "config.py;." --add-data "database.ini;." --add-data "images;images/" "app.py" which creates a dist folder and inside /dist/app I have my .exe but not only it still imports all my python modules (more than a hundred) but also I have the following error : failed to execute script pyi rth win32api
[EDIT 2] : I use Python 3.8 and the only libs used in my whole project are : numpy, pandas, PyQt5 and psycopg2; however pyinstaller also imports matplotlib or tkinter
Thanks!
it still imports all my python modules(more than a hundred)don't worry about that pyinstaller packages everything required for your script to run including the python compiler. If that worries you can use --onefile mode which will package all in a single .exe file.