Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/77.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 3.x 使用Pyinstaller将Ghostscript捆绑到python工具?_Python 3.x_Tkinter_Python Imaging Library_Pyinstaller_Ghostscript - Fatal编程技术网

Python 3.x 使用Pyinstaller将Ghostscript捆绑到python工具?

Python 3.x 使用Pyinstaller将Ghostscript捆绑到python工具?,python-3.x,tkinter,python-imaging-library,pyinstaller,ghostscript,Python 3.x,Tkinter,Python Imaging Library,Pyinstaller,Ghostscript,我使用的是Windows-10,Python 3.7,枕头版本6.0.0,tkinter 我开发了一个GUI工具,它使用tkitner库将tkinter画布保存为PostScript,然后使用PIL(Pillow)库将其转换为PNG文件。在我的电脑上,我已经安装了Ghostscript,我的工具工作得很好 在将我的工具与拼贴一起分发之后,他们可以将画布保存为PostScript fine,但是该工具无法转换为PNG文件,并且会出现关于Ghostscript的错误 OSError:无法在路径上找到

我使用的是Windows-10,Python 3.7,枕头版本6.0.0,tkinter

我开发了一个GUI工具,它使用tkitner库将tkinter画布保存为PostScript,然后使用PIL(Pillow)库将其转换为PNG文件。在我的电脑上,我已经安装了Ghostscript,我的工具工作得很好

在将我的工具与拼贴一起分发之后,他们可以将画布保存为PostScript fine,但是该工具无法转换为PNG文件,并且会出现关于Ghostscript的错误

OSError:无法在路径上找到Ghostscript

我想让我的同事能够运行该工具,而无需在这些机器上下载Ghostscript

我认为在使用Pyinstaller创建py_app.exe时,应该包括(捆绑)Ghostscript

有人知道怎么做吗,或者有其他建议

以下是错误消息:

  Exception in Tkinter callback
  Traceback (most recent call last):
  File "tkinter\__init__.py", line 1705, in __call__
  File "user_input.py", line 49, in save_as
  File "drawing_func.py", line 1232, in save_as_png
  File "site-packages\PIL\Image.py", line 1973, in save
  File "site-packages\PIL\Image.py", line 628, in _ensure_mutable
  File "site-packages\PIL\Image.py", line 621, in _copy
  File "site-packages\PIL\EpsImagePlugin.py", line 333, in load
  File "site-packages\PIL\EpsImagePlugin.py", line 139, in Ghostscript
  OSError: Unable to locate Ghostscript on paths

我建议先阅读Adobe的许可证。你可以捆绑吗?Ghostscript不是Adobe。Ghostscript由Artifex提供,并在AGPLv3下提供。如果您希望使用Ghostscript而不针对它进行链接,那么您几乎肯定需要运行Ghostscript安装程序(或者自己做很多工作)。显而易见的答案是包含Ghostscript安装程序,这也将免除您在AGPL下的任何进一步义务,因为在这种情况下,属性是明确的。我很确定Artifex不会为你自己安装Ghostscript而感到高兴,因为你的安装程序中没有明显的属性。你的意思是包括Ghostscript安装程序,只包括它的普通安装程序文件,然后拼贴应该手动下载到那里的PC上吗@KenSIf如果你的软件包中包含Ghostscritp安装程序,那么你的“拼贴”(大学?同事?)就不必下载它了。鉴于Ghostscript安装程序不仅仅是简单地将文件复制到磁盘上,您还需要复制安装程序的操作,因此提供安装程序肯定更容易。谢谢,我将尝试一下。(同事们!)我建议先阅读Adobe的许可证。你可以捆绑吗?Ghostscript不是Adobe。Ghostscript由Artifex提供,并在AGPLv3下提供。如果您希望使用Ghostscript而不针对它进行链接,那么您几乎肯定需要运行Ghostscript安装程序(或者自己做很多工作)。显而易见的答案是包含Ghostscript安装程序,这也将免除您在AGPL下的任何进一步义务,因为在这种情况下,属性是明确的。我很确定Artifex不会为你自己安装Ghostscript而感到高兴,因为你的安装程序中没有明显的属性。你的意思是包括Ghostscript安装程序,只包括它的普通安装程序文件,然后拼贴应该手动下载到那里的PC上吗@KenSIf如果你的软件包中包含Ghostscritp安装程序,那么你的“拼贴”(大学?同事?)就不必下载它了。鉴于Ghostscript安装程序不仅仅是简单地将文件复制到磁盘上,您还需要复制安装程序的操作,因此提供安装程序肯定更容易。谢谢,我将尝试一下。(同事们!)