简体   繁体   中英

Converting python file into executable in ubuntu 12.04 OS

I have developed a python script to automate few things present in text file. when converted this python file to the executable in ubuntu20.04 version(through pyinstaller) works very well.

The same executable is not working on ubuntu 12.04 OS(an older version Linux). However, the python file(.py) file works without any issues in 12.04 as well

Please do suggest how to convert the python file to the executable in ubuntu 12.04 OS version

python version: 2.7 ubuntu: 12.04 version

humm, probably execution permission issue.

run this in your terminal:

chmod 777 {file path/name}

this gives a file, read/write and execute permission to the current user.

also, another possible issue could be that you are compiling your python code for 64-bit system and your old system (ubuntu 12.04) is a 32-bit OS?

to find out, you can run this command:

uname -ipm

while you are compiling using pyinstaller pass this param:

pyinstaller --target-arch=32bit scripts

from pyinstaller doc , you can't make your compiled app on linux forward-compatible:

The GNU/Linux standard libraries such as glibc are distributed in 64-bit and 32-bit versions, and these are not compatible. As a result you cannot bundle your app on a 32-bit system and run it on a 64-bit installation, nor vice-versa. You must make a unique version of the app for each word-length supported.

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