簡體   English   中英

使用pyinstaller將python腳本轉換為可執行文件后,我得到:加載共享庫時出錯...權限被拒絕

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM