我想把.py文件转换成一个可执行文件,并在raspberry pi上运行。我安装了pyinstaller
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
我安装mono
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在空闲状态下编写)转换成一个可执行文件,并在我的raspberry pi上运行它。
将linux-32bits重命名为linux-32bits-arm仍会生成x86文件。您需要编译自己的linux-32bits-arm引导程序。
在PyInstaller分发目录中运行:
然后将整个../PyInstaller/bootloader/linux-32bits-arm复制到您重命名该bootloader的目录
在那之后它应该可以正常工作。
相关问题 更多 >
编程相关推荐