2017-01-03 86 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 

對不起!

相關問題