I wrote a python program in windows, then used pyinstaller to make it an .exe file. but the python program won't work in linux. why?
2 Answers
It's very likely the program you wrote will work in Ubuntu, but because Linux and Windows have very different API structure, you would need to recompile or run the program in a Python interpreter on the Linux system to have it work. Linux in general doesn't recognize Windows .exe files, though if you have Wine installed, your system may attempt to run the program as if it were a Windows program, using Wine to service its system calls -- and this might even work, depending how your pyinstaller structures the executable.
- 5,248
As mentioned in other answer try running in Python interpreter before compiling.
It is likely some code will have to be changed. For example if your original program contains:
INPUT_FNAME='\Documents\python_datain\today.csv
It would have to be change to:
INPUT_FNAME='~/Documents/python_datain/today.csv'
If it's low level python and does such things as moving mouse on screen, closing popup browser windows and adjusting screen brightness and color temperature many changes will be needed with added calls to xdotool, xrandr and possibly wmctrl.
- 105,762