如何使 py2app 和 cxfreeze 使用 Python 3 作为默认版本
How to make py2app and cxfreeze use Python 3 as default version
我正在尝试将名为 "applicationtest.py" 的脚本转换为独立的 osx 应用程序。我尝试使用 py2app 这样做:https://pythonhosted.org/py2app/tutorial.html, and with cxfreeze: http://cx-freeze.readthedocs.io/en/latest/script.html#script。这两个模块都会创建一个文件夹,其中包含您的新应用程序 + 所需的支持 packages/scripts/lib。
但是,当我查看这些文件夹时,我注意到库是为 python 2.7 设置的,而我想变成应用程序的脚本是用 3.6 编写的。
示例:
:dist username$ tree
给出:
.
└── applicationtest.app
└── Contents
├── Info.plist
├── MacOS
│ ├── applicationtest
│ └── python -> /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python
├── PkgInfo
└── Resources
├── PythonApplet.icns -> /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/Resources/PythonApplet.icns
├── __boot__.py
├── __error__.sh
├── lib
│ └── python2.7
│ ├── config -> /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config
│ └── site.pyc -> ../../site.pyc
├── site.py
└── site.pyc
7 directories, 10 files
问:如何设置创建应用程序时使用python3?
提前致谢!
发现我做错了什么。我需要 运行:
python3.6 setup.py py2app -A
而不是:
python setup.py py2app -A
对不起!
我正在尝试将名为 "applicationtest.py" 的脚本转换为独立的 osx 应用程序。我尝试使用 py2app 这样做:https://pythonhosted.org/py2app/tutorial.html, and with cxfreeze: http://cx-freeze.readthedocs.io/en/latest/script.html#script。这两个模块都会创建一个文件夹,其中包含您的新应用程序 + 所需的支持 packages/scripts/lib。
但是,当我查看这些文件夹时,我注意到库是为 python 2.7 设置的,而我想变成应用程序的脚本是用 3.6 编写的。
示例:
:dist username$ tree
给出:
.
└── applicationtest.app
└── Contents
├── Info.plist
├── MacOS
│ ├── applicationtest
│ └── python -> /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python
├── PkgInfo
└── Resources
├── PythonApplet.icns -> /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/Resources/PythonApplet.icns
├── __boot__.py
├── __error__.sh
├── lib
│ └── python2.7
│ ├── config -> /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config
│ └── site.pyc -> ../../site.pyc
├── site.py
└── site.pyc
7 directories, 10 files
问:如何设置创建应用程序时使用python3?
提前致谢!
发现我做错了什么。我需要 运行:
python3.6 setup.py py2app -A
而不是:
python setup.py py2app -A
对不起!