twibiral / obsidian-execute-code

Obsidian Plugin to execute code in a note.
MIT License
1.07k stars 67 forks source link

Issue with Running Python #227

Open williamwu062 opened 1 year ago

williamwu062 commented 1 year ago

when attempting to run python code, I am getting this errror

File "<stdin>", line 1 __globals_3542659721031336_1676496996699 = {**globals()} ^ SyntaxError: invalid syntax name '__globals_3542659721031336_1676496996699' is not defined

Currently I have my python path set as /usr/bin/python3 and I was just attempt to run print("hello world") as a test. Any help with this issue would be appreciated. Thank you.

twibiral commented 1 year ago

Hi @williamwu062, please give us more information, like OS, and the exact code block you used

eumenr commented 11 months ago

The same bug here. The system info as below:

When I am trying this:

print("Vault path:", @vault_path)

the result returned is as below:

name '__globals_6984937966833744_1696515121154' is not defined

Thank you for your attention.

It finally works a few days later. I don't know what I did right yet.

actsasgeek commented 10 months ago

I have the same issue.

print("hello there from obsidian")
name '__globals_7530913097808696_1698266731863' is not defined

MacOS: 11.3.1 Obsidian: 1.4.16 Execute Code: (just installed)

actsasgeek commented 10 months ago

so this is a little weird and I can't identify the state where it works or not but when I created a split screen with source view on the left and a reading view on the right...it works. ¯_(ツ)_/¯