简体   繁体   中英

After converting python script to executable with pyinstaller I get: error while loading shared libraries… Permission denied

I have a python script which adds a user using the command os.system('useradd user') . This code works fine when run like a python script like this sudo python script.py . However, once I convert it to executable with pyinstaller with the command python pyinstaller.py --onefile script.py , and run the executable like this sudo ./script , I get an error useradd: error while loading shared libraries: libselinux.so.1: failed to map segment from shared object: Permission denied . Any idea what is the issue and how to fix?

看起来os.system('sudo useradd user')解决了这个问题。

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