Skip to content

DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12 #954

@HeRo002

Description

@HeRo002

Hi!

When I deploy any Python-Kivy app on iOS 18.1.1 (or iOS 18.2), using Xcode 16.1 (or 16.2) on MacOS 15.0.1 I get this warning:

:1: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses

I know that I am running on the newest version of Kivy-ios. And since all my apps reproduce this error, no demo app is needed.

Versions

  • Python : 3.11.6
  • MacOS version : 15.0.1
  • XCode Version : 16.1 and 16.2
  • Cython version : 0.29.36
  • iOS version: 18.1.1 (or 18.2)

Describe the bug
Whenever I deploy a Python-Kivy app on my iPhone 12 Mini (running iOS 18.1.1 or iOS 18.2) I get this warning:

:1: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses

To Reproduce
Open any Kivy app in Xcode 16.1 or 16.2 and run it on an iOS device.

Expected behavior
If kivy-ios was prepared for Python 3.12, it would use importlib instead of imp.

Logs
From Xcode:

<string>:1: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses

Screenshots
Not relevant.

Additional context
I installed MacOS from scratch 2 or 3 months ago, because of a fatal problem.

According to ChatGPT:

If your app directly uses the imp module, replace its usage with importlib. Here are some common replacements:

Replace imp.find_module() with importlib.util.find_spec().
Replace imp.load_module() with importlib.util.module_from_spec() and spec.loader.exec_module().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions