如何指定PyInstaller使用的Python版本? [英] How to Specify Python Version PyInstaller Uses?

查看:15
本文介绍了如何指定PyInstaller使用的Python版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的系统上安装了Python2.7&;3.5。我使用的是OSX10.12。Python 2.7是系统上的默认值。

使用.

生成PyInstaller时
pyinstaller myscript.py

.PyInstaller使用Python 2.7。

可能我错过了,但在PyInstaller文档中找不到允许我指定Python版本的任何地方。

有人知道如何约束PyInstaller使用非默认的Python 3.5版吗?

我已尝试使用Macports生成。

使用命令后.

sudo port select python python35

我得到一个确认的.

Selecting 'python35' for 'python' succeeded. 'python35' is now active.

然后在尝试使用.

生成时
pyinstaller main.py --onefile 

PyInstaller显示它正在使用2.7.

68 INFO: PyInstaller: 3.2.1
68 INFO: Python: 2.7.13

我哪里出错了?

推荐答案

安装pyinstaller时使用pip3 install pyinstaller

这篇关于如何指定PyInstaller使用的Python版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆