Comments (1)
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)
- Can't get title bar to show when having a large screen size HOT 1
- Bug about pygame.draw.polygon() HOT 9
- Pygame Keyboard Event Handling Not Working with ALE Environment in WSL 2
- KEYDOWN监听不到字母 HOT 1
- I get an error when I log out of my game: (line 145 pygame.display.update(); pygame.error: video system not initialized) HOT 1
- Some SVGs don't display correctly HOT 2
- Segfault when _sdl2.Renderer gets garbage collected after window has been destroyed
- Pygame.mixer module not available? HOT 1
- Program causing Mac OS to freeze HOT 3
- `set_mode()` wont change the graphics mode the second time when OPENGL flag is used HOT 6
- litta
- Pygame fails to compile with GCC-14 HOT 4
- Deload a pygame.image HOT 1
- i keep on getting the following error on this code i found which is using pygame to control a RC car Traceback (most recent call last): line 27, in <module> main() , line 20, in main if getKey('LEFT'): line 9, in getKey for eve in pygame.event.get(): ^^^^^^^^^^^^^^^^^^ pygame.error: video system not initialized >>> HOT 7
- Inconsistent resize behavior w.r.t. pygame.SCALED
- Test failures against NumPy 2.0.0rc2 HOT 9
- Improve Pygame Installation Instructions
- Improve Pygame Installation Instructions
- Flicker Screen
- Mouse cannot focus on vscode when breakpoint on Ubuntu when mouse pressed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygame.