尝试运行 python 文件的可执行文件时出错


Fatal Python error: (pygame parachute) Segmentation Fault
Traceback (most recent call last):
     File "C:Python34libsite-packagespkg_resources__init__.py", line 1150, in resource_exists
          return get_provider(package_or_requirement).has_resource(resource_name)
     File "C:Python34libsite-packagespkg_resources__init__.py", line 1608, in has_resource
          return self.has(self.fn(self.module_path, resource_name))
     File "C:Python34libsite-packagespkg_resources__init__.py", line 1663, in _has
          "Can't perform this operation for unregistered loader type"
NotImplementedError: Can't perform this operation for unregistered loader type

把我制作的一个python游戏转换成了一个可执行文件。然后我去安装游戏,然后去运行它。当我运行可执行文件(刚刚安装(时,它会在cmd提示符中给我该错误,然后说应用程序停止工作。实际游戏中没有任何内容运行,它会立即停止工作。

我用cx_Freeze将其转换为可执行文件。我正在运行Python 3.4并安装了正确的cx_Freeze。

在我看到的这种错误的各种答案中。您的一个目录具有python模块,但它不是一个包。因此,对于您在cx_Freeze中使用的任何内容,请通过添加__init__.py文件将其转换为包。

最新更新