python-3.x - 如何指定PyInstaller使用的Python版本?

标签 python-3.x pyinstaller

我的系统上有 Python 2.7 和 3.5。我使用的是 OS X 10.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

关于python-3.x - 如何指定PyInstaller使用的Python版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42525896/

相关文章:

python - 生成的 Windows exe (pyinstaller) 无法加载 _cffi_backend

python - 即使我能够安装其他库,安装 pyinstaller 时也会出现 SSL 错误

python - 如何让不同的变量引用相同的值,同时仍然允许直接操作?

python - 这个 Python 示例仍在初始化对象吗(没有 __init__)

python - Pyinstaller 在文件提取过程中添加启动画面或视觉反馈

python-2.7 - Pyinstaller 生成的 exe 无法在另一台计算机上运行

python - 使用 pyinstaller 时没有模块名称 typedef

Python:没有依赖项的卡住选项?

python - type 和 object 原始对象的区别

python - 如何在Python中创建日期结构?