Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 安装程序所有者错误_Python_Exe_Executable_Pyinstaller - Fatal编程技术网

Python 安装程序所有者错误

Python 安装程序所有者错误,python,exe,executable,pyinstaller,Python,Exe,Executable,Pyinstaller,我需要构建一个独立的exe,它不需要在用户的计算机上安装python。我试过使用nuitka、cx_freeze,但它们也包括其他文件,或者在使用nuitka的情况下,它需要在客户端计算机上安装python。我正在使用Python2.7 这是我在尝试pyinstaller时遇到的错误: python C:\Users\root\Desktop\pyinstaller-2.0\pyinstaller.py --onefile C:\Users\root\Desktop\script.py T

我需要构建一个独立的exe,它不需要在用户的计算机上安装python。我试过使用nuitka、cx_freeze,但它们也包括其他文件,或者在使用nuitka的情况下,它需要在客户端计算机上安装python。我正在使用Python2.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>
python C:\Users\root\Desktop\pyinstaller-2.0\pyinstaller.py--onefile C:\Users\root\Desktop\script.py
回溯(最近一次呼叫最后一次):
文件“”,第3行,在
文件“C:\Users\root\Desktop\pyinstaller-2.0\pyinstaller\loader\iu.py”,第386行,在importHook中
mod=\u self\u doimport(nm、ctx、fqname)
文件“C:\Users\root\Desktop\pyinstaller-2.0\pyinstaller\loader\iu.py”,第459行,在doimport中
mod=director.getmod(nm)
文件“C:\Users\root\Desktop\pyinstaller-2.0\pyinstaller\loader\iu.py”,第248行,在getmod中
mod=owner.getmod(nm)
文件“C:\Users\root\Desktop\pyinstaller-2.0\pyinstaller\loader\archive.py”,第471行,在getmod中
localpath:gimporter(localpath,nm)},
文件“C:\Users\root\Desktop\pyinstaller-2.0\pyinstaller\loader\archive.py”,第491行,在\uuu init中__
iu.DirOwner.\uuuu init\uuuuu(self,path)
文件“C:\Users\root\Desktop\pyinstaller-2.0\pyinstaller\loader\iu.py”,第82行,在\uuu init中__
引发所有者错误(“%s”不是目录“%path”)
iu.Owner错误:

使用pyinstaller-1.5.1时,我不会出现此错误

您是专门向pyinstaller寻求帮助,还是在寻找替代方法?根据,这可能是pyinstaller版本中的已知错误。您使用的是最新版本吗?因为它在大约9个月前被标记为“已完成”。@amccormack感谢您救了我的命。我使用的是旧版本,它可以工作。你应该回答你自己的问题,你可以说你在工作时使用的是什么版本。这样,其他人将看到如何解决这个问题,如果他们遇到它。