Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
HeRo002 opened this issue Dec 13, 2024 · 0 comments

Comments

@HeRo002
Copy link

HeRo002 commented Dec 13, 2024

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().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant