Error when using json package in server code

What I’m trying to do:
I am trying to run code which worked correctly in uplink form that is now giving me an error when calling a json function.

What I’ve tried and what’s not working:
I had initially had a different error that looked like this:
JSONDecodeError: Expecting value: line 1 column 1 (char 0)

  • at C:/Users/NomiVilvovsky/anaconda3/envs/pyenv36/lib/json/decoder.py:357
  • called from C:/Users/NomiVilvovsky/anaconda3/envs/pyenv36/lib/json/decoder.py:339
  • called from C:/Users/NomiVilvovsky/anaconda3/envs/pyenv36/lib/json/__init__.py:354
  • called from <ipython-input-14-810d7d7ff82e>:262
  • called from Form1, line 17

Seemed that it was looking for the json package on my personal computer. I fixed this error by going into the form code and including “import json” there as well as in the server code.

Now the script runs until it reaches the first like that uses a json function. Here I get this error:
JSONDecodeError: Expecting value: line 1 column 1 (char 0)

  • at /usr/local/lib/python3.10/json/decoder.py:355
  • called from /usr/local/lib/python3.10/json/decoder.py:337
  • called from /usr/local/lib/python3.10/json/__init__.py:346
  • called from script, line 297
  • called from Form1, line 18

What does the JSON look like on line 297 if you printed it as a string instead of decoding it?
(Or from Form1, line 18)

Thanks! Feels a bit silly but looks like the JSON string wasn’t coming back right.

No worries, first rule of HelpDesk is “Is it plugged in?” :electric_plug:

I seriously installed stable diffusion from published source a few weeks ago and it proceeded to download config files in JSON that were not valid JSON straight out of the box.
(It crashed and I had to find and replace a single ' with a " :sweat_smile: )