Python3.x 的 Pyinstaller

Pyinstaller with Python3.x

我想在 Linux 中使用 Pyinstaller, but the problem is Pyinstaller 将我的脚本编译为二进制可执行文件 python 2.x 而不是 python 3.x. (构建过程成功,但我的脚本仅适用于 python 2.x。)。 日志:

$ pyinstaller script.py

22 INFO: PyInstaller: 3.1.1

22 INFO: Python: 2.7.6

22 INFO: Platform: Linux-4.2.0-34-generic-x86_64-with-Ubuntu-14.04

...

如何配置 Pyinstaller 以使用 Python 3.x 编译我的脚本。


我的问题解决了,使用pip3安装Pyinstaller:

sudo pip3 install pyinstaller

感谢帮助!

要使用 pip 为不同版本安装软件包,您可以使用 pip3 / pip2 / pip2.7 / pip3.5 etc. 因此在您的情况下,为 python 3 获取 pyinstaller 只需使用:

pip3 install pyinstaller