NIkola Bozin
NIkola Bozin

Reputation: 33

exe file made by pyinstaller has problem executing

Here is python script:

enter image description here

I used Visual Studio Code to run the file with this command:

enter image description here

And I get desired result:

enter image description here

Now I tried to create .exe file by opening PowerShell in the folder where is my script and running next line:

enter image description here

Here is stuff I got(not including otherScripts folder):

enter image description here

Now I open CMD, navigate to the desired folder, and run the .exe file with the next lines of code:

enter image description here

Here is what I get as my first warning:

enter image description here

And here is what I get as a Traceback(console instantly closed and I could not use the snipping tool to capture what was an error, so I run it through C# Win Form application and redirected standard error to a label in form):

enter image description here

I tried:

  1. pip install transformers -U.
  2. instead of --onefile, use command --onedir
  3. line 3 (import tqdm) in the script, was recently added to try to fix the error. Because it says that "tqdm was not found and is required by the application.", so I just put it there.
  4. Updating pyinstaller and transformers to the latest versions.
  5. Other stuff I don't remember right now.

None of these things worked. And I'm kinda stuck here. I would really appreciate any help to fix this problem.

Upvotes: 1

Views: 2402

Answers (3)

Running python3 -m pip install tqdm solved the problem.

Upvotes: 0

Kevin
Kevin

Reputation: 21

for me adding the "tqdm directories" to datas solved the problem :)

In script.spec:

datas=[
('C:\\<...>\\Lib\\site-packages\\tqdm', 'tqdm\\'),
('C:\\<...>\\Lib\\site-packages\\tqdm-4.50.2.dist-info', 'tqdm-4.50.2.dist-info\\'),
...],

Upvotes: 2

ChinDaMay
ChinDaMay

Reputation: 204

Try building with --exclude-module=torch?(Taken from: https://github.com/pyinstaller/pyinstaller/issues/4695)

Upvotes: 1

Related Questions