1. pygame
  2. pygame
  3. pygame
  4. Issues

Issues

Issue #189 new

Importing pygame.freetype

Tikhon Belousko
created an issue

I'm using Mac OS X 10.9 and when I'm trying to import pygame.freetype I'm getting the following error.

>>> import pygame.freetype
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/pygame/freetype.py", line 3, in <module>
    from pygame._freetype import *
ImportError: No module named _freetype

How can I fix it?

Comments (11)

  1. Tikhon Belousko reporter

    This is nice, but I just wanted to try pygame.freetype.Font class. To be honest I don't really need freetype feature right now. Is there any way to import freetype module?

  2. Jason Marshall

    Are you looking for pygame.ftfont.Font? There is no pygame.freetype.Font class class.

    (The existence of two FreeType Python scripts, ftfont.py and freetype.py, is confusing.)

  3. Jason Marshall

    I double-checked for freetype.Font.

    >>> import pygame
    >>> import pygame.freetype
    >>> pygame.freetype.Font
    <type '_freetype.Font'>
    >>> 
    

    So there is indeed a pygame.freetype.Font! I'm sorry. Font must have come from this importation of the _freetype extension module:

    from pygame._freetype import *
    

    The _freetype extension module must not have been built correctly for you.

  4. Log in to comment