2016-03-18 47 views
0

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

$ pyinstaller script.py

22 INFO:PyInstaller:3.1.1

22 INFO:Python的:2.7.6

22 INFO:平台:Linux-4.2.0-34-generic-x86_64-Ubuntu-14.04

...

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


我已经解决了我的问题,使用PIP 3安装Pyinstaller:

sudo pip3 install pyinstaller 

感谢您的帮助!

+1

'PIP3安装pyinstaller'?使用pip ** 3 **安装pyinstaller。 –

+0

是的!它解决了我的问题。谢谢! –

回答

3

要使用PIP不同版本的安装软件包,您可以使用pip3/pip2/pip2.7/pip3.5 etc.所以你的情况得到pyinstaller为Python 3只使用:

pip3 install pyinstaller