Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRITICAL BUG: AttributeError: module 'pygubu' has no attribute 'Builder' #288

Closed
lundeen-bryan opened this issue Dec 10, 2023 · 2 comments
Closed

Comments

@lundeen-bryan
Copy link

Preconditions
Windows 11 64bit OS
IDE VSCode
Pygubu version: 0.31

Pygubu is installed in the .venv directory and will run "Code" when exported from the code tab in Pygubu Designer, but will not run in app. Error msg below

Describe the bug
GIVEN user has pygubu
AND user copies the code from the "App" tab in Pygubu Designer and places it in a python file called helloworld.py
AND user has the helloworld.UI XML file in the same directory as the python file
THEN user gets critical error when running the helloworld.py app.

To Reproduce
Steps to reproduce the behavior:

  1. Press the "Run python file" button in VSCode while helloworld.py is in the window
    image

  2. See error
    Error specifically says:

Traceback (most recent call last):
  File "c:\Users\lunde\repos\pygubu\src\helloworld.py", line 31, in <module>
    app = HelloworldApp()
  File "c:\Users\lunde\repos\pygubu\src\helloworld.py", line 14, in __init__
    self.builder = builder = pygubu.Builder()
AttributeError: module 'pygubu' has no attribute 'Builder'

Expected behavior
Python should start a Tkinter app and run it.

Actual behavior
app doesn't run only errors out

Screenshots
See previous steps

Your Environment (please complete the following information):

  • OS: Win 11
  • Python version: 3.10
  • Pygubu version: 0.31
  • Designer version: 0.36

Additional context
This issue was raised in an earlier thread but inadequately described and no follow-up. See #190 (comment)

@lundeen-bryan
Copy link
Author

I discovered what the bug was. It was mine. I named the file pygubu.py and that's what caused it to call back to itself and not find the attribute 'Builder' because that would reside in the source code for pygubu.

If possible, please update the wiki to reflect that this will solve the issue if they get the error: AttributeError: module 'pygubu' has no attribute 'Builder'

@alejandroautalan
Copy link
Owner

Hello @lundeen-bryan thank you for the report. And sorry for the late response.

I discovered what the bug was. It was mine. I named the file pygubu.py and that's what caused it to call back to itself and not find the attribute 'Builder' because that would reside in the source code for pygubu.

I will update the wiki to inform about this sometimes common error.

Regards
Alejandro A.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants