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

[🐛 BUG] Getting OS Error while using the GUI module. #1779

Open
2 of 4 tasks
RandomArnab opened this issue Sep 11, 2024 · 14 comments
Open
2 of 4 tasks

[🐛 BUG] Getting OS Error while using the GUI module. #1779

RandomArnab opened this issue Sep 11, 2024 · 14 comments
Assignees
Labels
🖰 GUI Related to GUI hacktoberfest - 200💎💎 Issues rewarded by 200 points hacktoberfest hacktoberfest issues 🆘 Help wanted Open to participation from the community 💥Malfunction Addresses an identified problem. 🟨 Priority: Medium Not blocking but should be addressed

Comments

@RandomArnab
Copy link

RandomArnab commented Sep 11, 2024

What went wrong? 🤔

Can't use the GUI module properly.
image

Expected Behavior

File "C:\Users\arnaa\AppData\Local\Programs\Python\Python312\Lib\inspect.py", line 1096, in findsource
raise OSError('could not get source code')
OSError: could not get source code

Browsers

Chrome

OS

Windows

Acceptance Criteria

  • Ensure the new code is unit tested, and check that the code coverage is at least 90%.
  • Create related issues in taipy-doc for documentation and Release Notes.

Code of Conduct

  • I have checked the existing issues.
  • I am willing to work on this issue (optional)
@RandomArnab RandomArnab added the 💥Malfunction Addresses an identified problem. label Sep 11, 2024
@jrobinAV jrobinAV changed the title [🐛 BUG] <write a small description here> Getting OS Error while using teh GUI module. [🐛 BUG] Getting OS Error while using the GUI module. Sep 12, 2024
@FlorianJacta
Copy link
Member

What Taipy version are you using? Do you use any tools that can conflict with Taipy?

@RandomArnab
Copy link
Author

Taipy version is 3.1.1. I've tried it on multiple environments with python versions of 3.11 and 3.12 but got the same os error while calling the GUI module.

@FlorianJacta
Copy link
Member

FlorianJacta commented Sep 12, 2024

Thank you for the quick answer! Are you coding in a cloud environment?

Can you test:

from taipy.gui import Gui 

Gui(page="# Hello world").run()

@RandomArnab
Copy link
Author

No, I'm running locally.
Still the same error however.
image

@FlorianJacta
Copy link
Member

Did you create a brand new environment for your Taipy installation? Maybe, that could fix this issue.

@FabienLelaquais @FredLL-Avaiga Do you have any idea?

@RandomArnab
Copy link
Author

I tried both ways, on my pre-existing environment with 3.11 python version and on a new environment with 3.12.

@FredLL-Avaiga
Copy link
Member

if think the problem is that you're trying in the console and we need a file...

@FredLL-Avaiga
Copy link
Member

I guess we should give a proper error message

@FlorianJacta
Copy link
Member

FlorianJacta commented Sep 13, 2024

True, I can replicate the issue:

>>> from taipy.gui import Gui
>>> Gui("Hello").run()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\jacta\.conda\envs\4.0\Lib\site-packages\taipy\gui\gui.py", line 2705, in run
    self.__var_dir.set_default(self.__frame)
  File "C:\Users\jacta\.conda\envs\4.0\Lib\site-packages\taipy\gui\utils\_variable_directory.py", line 31, in set_default
    self.add_frame(frame)
  File "C:\Users\jacta\.conda\envs\4.0\Lib\site-packages\taipy\gui\utils\_variable_directory.py", line 38, in add_frame
    imported_var_list = _get_imported_var(frame)
                        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jacta\.conda\envs\4.0\Lib\site-packages\taipy\gui\utils\get_imported_var.py", line 21, in _get_imported_var
    st = ast.parse(inspect.getsource(frame))
                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jacta\.conda\envs\4.0\Lib\inspect.py", line 1279, in getsource
    lines, lnum = getsourcelines(object)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jacta\.conda\envs\4.0\Lib\inspect.py", line 1261, in getsourcelines
    lines, lnum = findsource(object)
                  ^^^^^^^^^^^^^^^^^^
  File "C:\Users\jacta\.conda\envs\4.0\Lib\inspect.py", line 1090, in findsource
    raise OSError('could not get source code')
OSError: could not get source code

You should use Python files to run a Taipy application.

@jrobinAV jrobinAV added 🖰 GUI Related to GUI 🆘 Help wanted Open to participation from the community 🟨 Priority: Medium Not blocking but should be addressed labels Sep 13, 2024
@jrobinAV jrobinAV added hacktoberfest hacktoberfest issues hacktoberfest - 200💎💎 Issues rewarded by 200 points labels Sep 25, 2024
@Paulie-Aditya
Copy link

using python files should solve the issue. As far as I understood the issue is occurring due to the code being run on a python console

@SGCODEX
Copy link

SGCODEX commented Sep 30, 2024

@jrobinAV @Dr-Irv
Hi, please assign me this issue under Devfest ai and Hacktoberfest

@FlorianJacta FlorianJacta assigned SGCODEX and unassigned SGCODEX Oct 1, 2024
@FlorianJacta
Copy link
Member

It seems that you are already assigned to another issue @SGCODEX

@aniketh-varma
Copy link

Hi @FlorianJacta, I can work on this issue. It would be great if you could explain the steps required to solve the issue/preferred solution since this will be my first PR for this repo.

@jrobinAV
Copy link
Member

jrobinAV commented Oct 1, 2024

@aniketh-varma Let me assign the issue to you. Thanks for your help.

For your questions, I let @FabienLelaquais @FredLL-Avaiga @dinhlongviolin1 @namnguyen20999 answer. They are the right persons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖰 GUI Related to GUI hacktoberfest - 200💎💎 Issues rewarded by 200 points hacktoberfest hacktoberfest issues 🆘 Help wanted Open to participation from the community 💥Malfunction Addresses an identified problem. 🟨 Priority: Medium Not blocking but should be addressed
Projects
None yet
Development

No branches or pull requests

7 participants