Everything works fine when I run it on my computer. When I send it to friends, ho"/>
  简体   繁体   中英

pyinstaller: app won't run on other computers?

I used PyInstaller to successfully turn a very basic python program (that prints a few things to the console) into a one file executable on my MacBook Pro:

名为 <code>Test_App</code> 的捆绑应用程序

Everything works fine when I run it on my computer. When I send it to friends, however, it doesn't run. I've tried sending through email/google drive (in which it turns into a TextEdit Document) and sending it through Facebook (in which it turns into a .jpg file).

I read here that no file extension means the system has no idea what application to use to open the program. So I have a few questions:

  1. What file extension(s) do I need to give this to get it to run?
  2. Will PyInstaller ever give a mac program a file extension? (I've noticed on Windows it gives it the .exe extension it needs)

If you archive the file into a zip archive, for example, it should preserve the executable properties.

Most Emails (and maybe Facebook) use virus scanners on any file uploads and are able to deny/rewrite your file so that it isn't seen as potentially harmful

I have also met this question and I just use cv2 to read the image. The program works well on my computer and did not work on other machines. No error message has been shown. Later I found that cv2 can not read an image from the path which has Chinese characters. In my computer image path don't have Chinese characters. However, in other machine image path have Chinese characters. After reading the image, if it is None, I just return from the function, which leads to no error message and the program was not running in the right way.

To sum up, if this happens to you and no error messages pop, you should think about the difference between the two machines' environments(file path, external file, os setting...) and check your program.

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