Home > database >  How can I run the file created with pyinstaller in ubuntu terminal?
How can I run the file created with pyinstaller in ubuntu terminal?

Time:12-20

On Windows, I can convert my python code to exe file using pyinstaller. And by running the resulting exe file, I can get the same output as in the normal code. In order to do the same on Ubuntu, I created the file with pyinstaller on Ubuntu again. But I couldn't find how to run this resulting file. Can you help with this?

For example:

After using pyinstaller on Windows, the file was created as:

example.py → example.exe

After using pyinstaller on Ubuntu, the file was created as:

example.py → example

But here I could not run the example file in any way.

CodePudding user response:

  1. In your terminal cd into the directory containing the executable. It should be in a dist/ folder.

  2. Then run ./example If that doesn't work it just means that the execution bit isn't set on the file.

  3. chmod x ./example

  4. ./example

  • Related