2017-01-03 41 views
0

我试图将名为“applicationtest.py”的脚本转换为独立的osx应用程序。我试图用py2app:https://pythonhosted.org/py2app/tutorial.html和cxfreeze:http://cx-freeze.readthedocs.io/en/latest/script.html#script。两个模块都创建一个文件夹,其中包含您的新应用程序+所需的支持包/脚本/库。如何使py2app和cxfreeze使用Python 3作为默认版本

但是,当我查看这些文件夹时,我注意到该库设置为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 

问:如何设置的Python 3创建应用程序时使用?

在此先感谢!

回答

0

发现我做错了什么。我需要运行:的

python3.6 setup.py py2app -A 

代替:

python setup.py py2app -A 

对不起!

相关问题