我的系统上有 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/