Git Product home page Git Product logo

Comments (1)

RaphyStark avatar RaphyStark commented on June 11, 2024

Hi, I also have a problem when trying to use "font" :

Python 3.6.9 (default, Mar 10 2023, 16:46:00) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
_frozen_importlib:219: RuntimeWarning: Your system is avx2 capable but pygame was not built with support for it. The performance of some of your blits could be adversely affected. Consider enabling compile time detection with environment variables like PYGAME_DETECT_AVX2=1 if you are compiling without cross compilation.
/home/raphael/projects/robotNav_PROJECT/robotNavVenv/lib/python3.6/site-packages/pygame-2.6.0.dev1-py3.6-linux-x86_64.egg/pygame/pkgdata.py:25: UserWarning: Module pygame was already imported from /home/raphael/projects/robotNav_PROJECT/robotNavVenv/lib/python3.6/site-packages/pygame-2.6.0.dev1-py3.6-linux-x86_64.egg/pygame/__init__.py, but /home/raphael/projects/robotNav_PROJECT/pygame is being added to sys.path
  from pkg_resources import resource_stream, resource_exists
pygame 2.6.0.dev1 (SDL 2.0.8, Python 3.6.9)
Hello from the pygame community. https://www.pygame.org/contribute.html
>>> pygame.init()
(2, 0)
>>> font = pygame.font.SysFont(None, 36)
__main__:1: RuntimeWarning: use font: cannot import name 'Font'
(ImportError: cannot import name 'Font')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/raphael/projects/robotNav_PROJECT/robotNavVenv/lib/python3.6/site-packages/pygame-2.6.0.dev1-py3.6-linux-x86_64.egg/pygame/__init__.py", line 70, in __getattr__
    raise NotImplementedError(missing_msg)
NotImplementedError: font module not available (ImportError: cannot import name 'Font')

I first installed pygame via pip, then uninstalled it and followed the https://www.pygame.org/wiki/CompileUbuntu instructions when using virtual environment (but I use python venv instead of mkvirtualenv).

Looked for other related issues but didn't find a solution.
#2150
#2500
https://stackoverflow.com/questions/20842801/how-to-display-text-in-pygame
https://stackoverflow.com/questions/17823923/pygame-font-module-not-available
https://forums.fedoraforum.org/showthread.php?289229-Pygame-no-font

pygame.freetype doesn't work neither since it use font.

Thanks for your help.

from pygame.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.