简体   繁体   中英

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

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.

  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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM