Convert Python to exe

Asked

Viewed 2,244 times

2

I have an app made in python that pulls several Imports, and my client does not want to install Python in his environment (because it is an Oracle server), the output I found was to create one . exe however when I create the same (using pyinstaller) while trying to do the test on Windows it does not open (than the file is not recognized), I use one of this linux with:

  1. Python 2.7
  2. Python 3.5
  3. Python 3.8

Follow the imports that use in the application

import glob, os, time, datetime

PS: While testing in windows I copy both dist and build folder.

Someone can give me a light?

@EDIT

Following the tip, I did the same process (CMD > pyinstaller Arq.py), now windows comes to recognize but when trying to run it presents the error below: inserir a descrição da imagem aqui When running Python itself, it runs bboa the script (this script connects to the database and takes some information)

  • 1

    I believe it would be ideal for you to put the steps of how you generated this exe also.

  • Did you use the pyinstaller on this linux with Wine? If not it compiles only for linux... Because pyinstaller uses some native OS files to generate the executable.

  • danieltakeshi thanks you for the tip, I will upload a VM with python and install the pyinstall in it and do the test Aja put here the return

  • The solution to the problem must be in the area of answers, not in the question, as well as putting "SOLVED" in the title is unnecessary, since you have already accepted an answer, indicating that it solved the problem.

1 answer

0


pyinstaller generates executables for windows if run on windows. Running pyinstaller on linux will generate an executable for linux.

One way around that is to use the Wine. Create a new prefix and install the python, the libs you want and the pyinstaller, so you can generate executables on linux and use in windows.

Remembering that what pyinstaller does is to put python and all libs inside exe, so if your client doesn’t want to install python, it’s worse for him because every time. exe will have python inside.

EDIT:

It seems that now you are using Python 3.7 in windows - It seems that you have a pyinstaller bug in this version of python - try using Python 3.6;

  • Fala man blz? I just edited the article informing about the test I did and the error that came up

  • In my case, I took the test on the VM.

  • @Wallacebrunogentil edited the answer

  • Guy solved the problem vlw! I will edit the question and put what was done

  • @Wallacebrunogentil no problem! Just accept the answer and vote up!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.