0

I get the error:

ValueError: dictionary update sequence element #0 has length 1; 2 is required

at the output of this line:

pprint.pprint(dict(os.environ['MOTECOM']), width= 1)

I'm using Python 3.6.2 on docker container.

BlueCurve
  • 33
  • 1
  • 7
  • Does this answer your question? [Error: "dictionary update sequence element #0 has length 1; 2 is required" on Django 1.4](https://stackoverflow.com/questions/17610732/error-dictionary-update-sequence-element-0-has-length-1-2-is-required-on-dj) – Cireo Jul 01 '21 at 19:19

1 Answers1

0

You get this error when messing around with dict and str. Using literal_eval should help:

>>> pprint.pprint(literal_eval(os.environ['MOTECOM']), width= 1)
'MOTECOM value'
Yoav Ben Haim
  • 109
  • 1
  • 7