[英]Permission denied after using PyInstaller to create Python executable
[英]After converting python script to executable with pyinstaller I get: error while loading shared libraries… Permission denied
我有一個使用os.system('useradd user')
命令添加用戶的python腳本。 當像sudo python script.py
這樣的python腳本運行時,此代碼可以正常工作。 但是,一旦我使用命令python pyinstaller.py --onefile script.py
使用pyinstaller將其轉換為可執行文件,並像sudo ./script
這樣運行可執行文件,就會收到錯誤useradd: error while loading shared libraries: libselinux.so.1: failed to map segment from shared object: Permission denied
。 任何想法是什么問題以及如何解決?
看起來os.system('sudo useradd user')
解決了這個問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.