Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ModuleNotFoundError: No module named 'pygame._freetype'

Aperta
#3,097 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
android, python

Direzione di ricerca

Inizia da buildozer.spec e dall’output della build Android per Render.py, quindi segui l’import da pygame/freetype.py fino al modulo mancante pygame._freetype. Riproduci il fallimento dell’APK e determina perché quel modulo è assente dall’applicazione pacchettizzata; il lavoro è concluso quando l’APK installato importa correttamente pygame.freetype.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

need-analysis pygame backend recipe

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,
    ...

Lingua principale
Python
Stelle
8.9k
Fork
2k
Merge medio
12h 18m
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di kivy/python-for-android

Tutte le issue di kivy/python-for-android

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.