给定:
-Ubuntu
-py2exe和pyinstaller
使用setup.py的Python脚本或其他from distutils.core import setup
import py2exe
导入操作系统
设置(
版本=' 1.0 ',
描述=' foo ',
url=' ',
name='foo ',
控制台=[{
' script':'main.py ',
' dest_base':'foo ',
()、
zipfile='shared.dll ',
options={'py2exe':{
' bundle_files': 1,
' optimize': 2,
' dll _ excludes ' : [ ' msvcp90.dll ',' msvcr71.dll ',' IPHLPAPI.DLL ',' NSI.dll ',' WINNSI.DLL '
' includes': ['utils']
}
)
需要:
-一个. exe文件和几个. dll (我真的不知道) )。
我做的步骤:
设置pip3和python 3.4 (https://ask Ubuntu.com/questions/524399/issues-with-py2exe )
为ubuntu“pip3安装py2exe”设置py2exe
运行python3.4 setup.py py2exe ",获取跟踪后退(mostrecentcalllast ) :
File 'setup.py ',line 2,in
import py2exe
file '/usr/local/lib/python 3.4/dist-packages/py2exe/_ init _.py ',line 9,in
patch_distutils ()
file '/usr/local/lib/python 3.4/dist-packages/py2exe/patch _ distutils.py ',line 68,in patch_distutils
from . import distutils_buildexe
file '/usr/local/lib/python 3.4/dist-packages/py2exe/distutils _ build exe.py ',line 91,in
from . import runtime
file '/usr/local/lib/python 3.4/dist-packages/py2exe/runtime.py ',line 3,in
from .dllfinder import Scanner,pydll
file '/usr/local/lib/python 3.4/dist-packages/py2exe/dll finder.py ',line 5,in
from . import _wapi
file '/usr/local/lib/python 3.4/dist-packages/py2exe/_ wapi.py ',line 4,in
_Kernel32=windll(Kernel32 ) ) ) ) ) ) ) ) ) ) )
name error : name ' win dll ' is not defined
-为Ubuntu (https://github.com/pyInstaller/py installer/wiki )安装py installer
运行pyinstaller setup.py (与pyinstaller-w setup.py相同),并在dist文件夹中找到许多扩展名为. so的文件和许多没有扩展名的文件“setup”
我做了什么?
如何在Ubuntu上获取. exe文件?
有可能吗?