-
Notifications
You must be signed in to change notification settings - Fork 875
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
Comments
What Taipy version are you using? Do you use any tools that can conflict with Taipy? |
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. |
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() |
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? |
I tried both ways, on my pre-existing environment with 3.11 python version and on a new environment with 3.12. |
if think the problem is that you're trying in the console and we need a file... |
I guess we should give a proper error message |
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. |
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 |
It seems that you are already assigned to another issue @SGCODEX |
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. |
@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. |
What went wrong? 🤔
Can't use the GUI module properly.
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
Code of Conduct
The text was updated successfully, but these errors were encountered: