pygame_gui icon indicating copy to clipboard operation
pygame_gui copied to clipboard

ImportError: cannot import name 'DIRECTION_LTR' from 'pygame'

Open W5DEV opened this issue 8 months ago • 0 comments

Describe the bug When using the Quick Start Guide, I am constantly getting the following error: ImportError: cannot import name 'DIRECTION_LTR' from 'pygame'

I am using an M1 Macbook Pro and my code is exactly as the quick start guide shows, with corrected formatting.

Quick Start Guide Code: Screenshot 2024-06-30 at 2 50 57 AM

My Code: Screenshot 2024-06-30 at 2 51 26 AM

To Reproduce Steps to reproduce the behavior:

  1. Install pygame
  2. Test initial code in QuickStartGuide (this works fine)
  3. Install pygame_gui using the exact commands in the QuickStartGuide
  4. Test the next block of code

Expected behaviour I expect that when I run the next block of code (or any code with pygame_gui imported), I don't get any bugs. This code, for example, should render the window with a button. However it also crashes:

Screenshot 2024-06-30 at 2 53 08 AM

Screenshots If applicable, add screenshots to help explain your problem.

Platform and software (please complete the following information):

  • OS: MacOS Sonoma 14.5
  • Pygame GUI version 0.6.12
  • Pygame version 2.6.0

Additional context

Traceback:

pygame 2.6.0 (SDL 2.28.4, Python 3.12.3)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "/Users/jl/Desktop/GitHub/python-legends-and-legacies/game_window.py", line 2, in <module>
    import pygame_gui
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pygame_gui/__init__.py", line 7, in <module>
    from pygame_gui.ui_manager import UIManager
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pygame_gui/ui_manager.py", line 8, in <module>
    from pygame_gui.core.interfaces import IUIManagerInterface
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pygame_gui/core/__init__.py", line 1, in <module>
    from pygame_gui.core.ui_appearance_theme import UIAppearanceTheme
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pygame_gui/core/ui_appearance_theme.py", line 11, in <module>
    from pygame_gui.core.interfaces.gui_font_interface import IGUIFontInterface
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pygame_gui/core/interfaces/__init__.py", line 2, in <module>
    from pygame_gui.core.interfaces.font_dictionary_interface import IUIFontDictionaryInterface
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pygame_gui/core/interfaces/font_dictionary_interface.py", line 2, in <module>
    from pygame import DIRECTION_LTR
ImportError: cannot import name 'DIRECTION_LTR' from 'pygame' (/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pygame/__init__.py)

W5DEV avatar Jun 30 '24 07:06 W5DEV