0

我有一个使用 PyGui 包的简单应用程序启动并运行。在我决定一切正常后,我重构了我的代码,基本上将它分解为多个文件,但我相当确定我没有更改任何文件的位置。现在,当我尝试运行我的应用程序时,它给了我以下错误:

Traceback (most recent call last):
File "blobedit.py", line 16, in <module>
    from GUI import Application, ScrollableView, Document, Window, Cursor, rgb
  File "/Users/<myusername>/Desktop/BlobEdit/GUI/__init__.py", line 54, in <module>
    raise ImportError("Unable to find an implementation of PyGUI for this installation")
ImportError: Unable to find an implementation of PyGUI for this installation

我已经尝试移动文件数周了,但找不到问题。任何帮助将非常感激!

4

1 回答 1

0

您有一个目录GUI,并且在其中__init__.py,这使该目录成为可导入的包。

不幸的是,PyGUI提供了一个 GUI 包。由于 Python 搜索要导入的包的方式,您GUI首先出现,这就是导致问题的原因。

解决它的简单方法是将您的 GUI 目录重命名/Users/Destkop/BlobEdit/GUI为其他名称。

于 2016-03-20T04:31:43.320 回答