I have a pygame game and I want to use pygame.gfxdraw.aacricle(), but whenever I do it gives me an error:
AttributeError: 'module' object has no attribute 'gfxdraw'
How do I install gfx for python 2.7?
I have a pygame game and I want to use pygame.gfxdraw.aacricle(), but whenever I do it gives me an error:
AttributeError: 'module' object has no attribute 'gfxdraw'
How do I install gfx for python 2.7?
I had this same issue using gfxdraw in pygame as well. Once I imported the module explicitly, there were no issues. Adding this line after importing pygame fixed the issue:
import pygame.gfxdraw
Curiously, I don't need to import pygame.draw explicitly in order to use it.
Here is the compilation and installation guide for gfx.
For the basic install it's the standard:
python setup.py build
python setup.py install
Or did you already try this and run into some problems?
pygame.gfxdraw
, but gfx
. I just tested my pygame, and import pygame.gfxdraw
worked. I don't believe I did a second install, just pygame-1.9.2-pre. –
Librettist © 2022 - 2024 — McMap. All rights reserved.