V
V
Vitaly2018-02-20 16:23:02
Python
Vitaly, 2018-02-20 16:23:02

How can I build a working exe file using Pyinstaller if I use third-party libraries?

All good!
I'm trying to compile my scripts to exe.
In scripts I use third-party libraries (flask and pyserial). The project itself consists of two files: the first is a large class (api manager) and the second is the one that needs to be launched, in which I import the first script + flask. The project structure is as follows:

-project
    -api.py
    -to_run.py

Everything compiles fine, with the command pyinstaller.exe --onefile --windowed --icon=app.ico to_run.py But
then the finished executable doesn't run : filed to execute script simple script with print("Hello Word!") - everything works fine. Please tell me how to solve this problem

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2018-02-23
@sanya84

You have not added to the api.py executable here is the PyInstaller PyQt5
link
how to add a ui file?
you will understand everything there)
if, of course, the question is relevant

D
David Chuck, 2018-05-30
@Chaki09

Try reinstalling "Microsoft Visual C++ 2015 Service Pack"

O
onevetka, 2018-11-19
@onevetka

First, add "main.py" at the end of the line. And you, most likely, did not add some files required by the script. Then you will have a default spec file. In his Analysis section, add other scripts after main.py, and in datas in brackets ('File_name', 'folder_where_this_file'). For example, for me it was datas=[('data/Settings.txt', 'data'), ('data/CossacksPlayers.json', 'data'), ('images/LogoLOP.png', 'images'), ('LOfP.ico', '.')]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question