Xirider / LiveCode

Real-time python variable evaluation
MIT License
13 stars 2 forks source link

Live Code dont work #18

Open azazel912 opened 5 months ago

azazel912 commented 5 months ago

Hello, I encountered an error that does not allow me to open the live code, after I run it I see this text Print Output: Traceback (most recent call last): File "c:\Users\leandre.vscode\extensions\xirider.livecode-1.3.10\node_modules\arepl-backend\python\arepl_python_evaluator.py", line 11, in import astunparse File "c:\Users\leandre.vscode\extensions\xirider.livecode-1.3.10\node_modules\arepl-backend\python\astunparseinit.py", line 3, in from six.moves import cStringIO ModuleNotFoundError: No module named 'six.moves' I tried to somehow solve this problem or find a solution on the Internet but it didn’t help, please help me with my problem, thanks in advance

RickeyChen0805 commented 5 months ago

me to!

UniXingKong commented 5 months ago

I have same problem.

TheTommyUknow commented 5 months ago

same here, find any solution?

TheTommyUknow commented 4 months ago

@Xirider, hey, this issue is still unresolved and it really needs to be fixed, thank you.

qq1073972124 commented 4 months ago

go to the given path and edit init.py change line 3 to: from io import StringIO change all cStringIO to StringIO

MicalWillen commented 4 months ago

go to the given path and edit init.py change line 3 to: from io import StringIO change all cStringIO to StringIO

no use

qq1073972124 commented 4 months ago

go to the given path and edit init.py change line 3 to: from io import StringIO change all cStringIO to StringIO

no use

for me print statement and error message is working but it still wont show variables

Slimaure commented 3 months ago

go to the given path and edit init.py change line 3 to: from io import StringIO change all cStringIO to StringIO

Works for me

ndawghoodstar commented 2 months ago

Same issue, changing cstring to string doesn't work

apitofme commented 1 month ago

The issue appears to be in the python-astunparse module rather than the Live Code extension itself (or the python-six module). Perhaps this issue needs to be reported there?

go to the given path and edit init.py change line 3 to: from io import StringIO change all cStringIO to StringIO

I do not like the idea of editing 3rd-Party source files directly, my feeling is that it should be fixed at source for everyone.

However since the issue seems to originate "upstream" I have tried this solution and it does work for me. Although I would appreciate clarification -- Answer's with explanations are always best ;) i.e. What is the cause of the problem and why does this action solve it?

The python-six module is a compatibility layer between Python 2.x and Python 3.x, wherein the six.moves module is used to 'provide a consistent interface' for certain functions that have been relocated to different modules in Python 3.x.

So all we're doing is changing the import statement to refer to the standard io module rather than reference one via six (where I assume "cStringIO" refers to a pre-compiled module's static source file in C), then simply updating the references.

I do not know how dependent on or how closely tied to these external modules the Live Code extension is, however some investigating on my part seems to suggest that since Python 3.9 the astunparse module may no longer be required as equivalent functionality is now included in the standard library.

Some sort of "official" clarification on this issue would be much appreciated.

Almenon commented 1 month ago

While you're waiting for Xirider to fix this, you could use https://github.com/Almenon/AREPL-vscode as an alterative. It's a VSCode extension similar to LiveCode (the codebase was forked from AREPL-vscode, actually). AREPL-vscode does not have this problem as it does not use astunparse.

leandrofelipesantanna commented 3 weeks ago

While you're waiting for Xirider to fix this, you could use https://github.com/Almenon/AREPL-vscode as an alterative. It's a VSCode extension similar to LiveCode (the codebase was forked from AREPL-vscode, actually). AREPL-vscode does not have this problem as it does not use astunparse.

Awesome tip!!! It works very well.