我需要构建一个不需要在用户计算机上安装 python 的独立 exe。我尝试使用nuitka,cx_freeze,但它们还包含其他文件,或者如果使用nuitka,它需要在客户端计算机上安装python。我使用 python 2.7 这是我尝试使用 pyinstaller 时遇到的错误:
python C:\Users\root\Desktop\pyinstaller-2.0\pyinstaller.py --onefile C:\Users\root\Desktop\script.py
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "C:\Users\root\Desktop\pyinstaller-2.0\PyInstaller\loader\iu.py", line 386, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "C:\Users\root\Desktop\pyinstaller-2.0\PyInstaller\loader\iu.py", line 459, in doimport
mod = director.getmod(nm)
File "C:\Users\root\Desktop\pyinstaller-2.0\PyInstaller\loader\iu.py", line 248, in getmod
mod = owner.getmod(nm)
File "C:\Users\root\Desktop\pyinstaller-2.0\PyInstaller\loader\archive.py", line 471, in getmod
localpath: ExtInPkgImporter(localpath, nm)},
File "C:\Users\root\Desktop\pyinstaller-2.0\PyInstaller\loader\archive.py", line 491, in __init__
iu.DirOwner.__init__(self, path)
File "C:\Users\root\Desktop\pyinstaller-2.0\PyInstaller\loader\iu.py", line 82, in __init__
raise OwnerError("%s is not a directory" % path)
iu.OwnerError: <OwnerError C:/Users/root/AppData/Local/Temp/_MEI54282/ is not a directory>