我想將.py文件轉換爲可執行文件並在Raspberry Pi上運行。我安裝了pyinstaller如何在Raspberry Pi上運行可執行文件
sudo apt-get install pyinstaller
sudo pyinstaller test.py
這個命令創建一個test.spec文件和dist文件夾。
cd dist/test
那裏我有一個名爲test的可執行文件。現在我想運行它
sudo ./test
error: ./test: 1: ./test: Syntax error: "(" unexpected
我安裝單
sudo apt-get install mono-complete
sudo mono test.exe
錯誤:
no such file on the directory
然後我用
sudo mono test
錯誤顯示:
cannot open assembly'test':file does not contain a valid CIL image
我該如何解決我的問題。我想將我的代碼(.py寫入空閒)轉換爲可執行文件並在我的覆盆子pi上運行。
你試過'chmod'嗎? – fugu
請嘗試使用更簡單的python腳本來重現您的問題,並將其添加到您的問題中。另外:你的pyinstaller和mono版本是什麼? – toussa
是的,我使用sudo chmod u + x測試。但結果是一樣的 –