最近使用树莓派时,需要将一个pyqt5生成的py文件打包成exe文件,用到了pyinstaller,使用pip下载pyinstaller
pip install pyinstaller或pip3 install pyinstaller
后使用该命令时却显示:
bash: pyinstaller: 未找到命令...
改用下载安装pyinstaller的形式也还是无法使用该命令。https://github.com/pyinstaller/pyinstaller/tarball/develop
后来选择更新pip,删除重下载多次,所在目录加入环境变量中等方法均无法解决。
最后,查阅各种资料后,发现可以运行 sudo -i
获得 root 访问权限,然后再次安装 pyinstaller:
pip3 install pyinstaller
后成功使用pyinstaller来打包文件。
pyinstaller -Fw xxx.py