ModuleNotFoundError: No module named 'pygame._freetype'
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- android, python
- Domain
- build-system, mobile
Research direction
Start with buildozer.spec and the Android build output for Render.py, then trace the import from pygame/freetype.py to the missing pygame._freetype module. Reproduce the APK failure and determine why that module is absent from the packaged application; done means the installed APK imports pygame.freetype successfully.
Written by the indexing model from the issue text.
Description
I wrote the following code. It works in my windows with python 3.11.
It also worked when i use "python for android" to compile the android apk.
But the apk is failed when i run the apk after install the apk.
I tried many times, all failed, hope for you help and support. Thanks!!!
The error msgs are as following:
12-15 14:15:08.131 26124 14916 I python : File "/home/liuxiaoming/txtreader/.buildozer/android/app/Render.py", line 2, in
12-15 14:15:08.131 26124 14916 I python : File "/home/liuxiaoming/txtreader/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/python-installs/txtreader/arm64-v8a/pygame/freetype.py", line 3, in
12-15 14:15:08.131 888 22230 I netd : interfaceSetEnableIPv6(wlan1, true) <0.17ms>
12-15 14:15:08.131 26124 14916 I python : ModuleNotFoundError: No module named 'pygame._freetype'
12-15 14:15:08.131 26124 14916 I python : Python for android ended.
I have checked my buildozer.spec, all the requirements are there, including the pygame-ce:
requirements = python3==3.10.12, kivy==2.3.0, hostpython3==3.10.12, pyjnius==1.5.0,
pygame==2.6.1, pygame-ce==2.5.2, chardet, jieba, zhconv, bs4, ebooklib
And my python code are as following, seems no problem.
import pygame as pg
from pygame import freetype as ft # [[[trigger the problem]]]
import pygame.freetype as ft
...
ft.Font(self.cfg.font_name, size=self.fonts_size[i], ) for i in range(len(self.fonts_size))
...
I also checked the freetype.pc, line 3 is import the Font.
from pygame._freetype import (
Font,
...
- Dominant language
- Python
- Stars
- 8.9k
- Forks
- 2k
- Avg merge
- 12h 18m
- Merged PRs (30d)
- 7
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from kivy/python-for-android
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
kivy/python-for-android#3335 · 1 comment · 3 reactions ·
Maintainers usually reply within 1 day
-
Documentation easy
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
kivy/python-for-android#3326 · 1 comment ·
Maintainers usually reply within 1 day
-
Documentation easy Priority: Low
Difficulty 1/5 Under an hour Newbie friendliness 88/100
kivy/python-for-android#3299 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
kivy/python-for-android#3382 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
kivy/python-for-android#3381 ·
Maintainers usually reply within 1 day
All issues in kivy/python-for-android
Similar issues
-
correction metadata
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
acl-org/acl-anthology#10104 · 1 comment ·
Maintainers usually reply within 1 day
-
bug status/needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
prowler-cloud/prowler#12885 · 1 comment ·
Maintainers usually reply within 1 day
-
Bug in GaussianTailProbabilityCalibrator: running_statistics=False still uses a windowed varianceOpenbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
selimfirat/pysad#107 ·
Maintainers usually reply within 1 day
-
bug ci-failure high priority
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vllm-project/vllm-omni#8194 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day