I am trying to connect to Bonsai using Python and for this I am using the code provided by Bonsai here. However, my code breaks at
bonsai = os.environ['https://username:[email protected]:443']
with error
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/lib/python3.7/os.py", line 679, in __getitem__
raise KeyError(key) from None
KeyError: 'https://username:[email protected]:443'
I am using the exact same code Bonsai provides and I am only adding the Full Access URL also provided by Bonsai so I have no idea how to proceed with this. Any ideas what is causing the error?
You have to set environment variable first. example
and then use it in code like
Check How to set environment variables in Python