I am trying to use glog in my python code and when I am trying to import, it throws the following error:
/usr/local/lib/python2.7/dist-packages/glog.py:171: RuntimeWarning:
Trying to access flag verbosity before flags were parsed. This will raise
an exception in the future.
setLevel(FLAGS.verbosity)
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/glog.py", line 171, in
<module>
setLevel(FLAGS.verbosity)
File "/usr/local/lib/python2.7/dist-packages/gflags/flagvalues.py", line
390, in __getattr__
traceback.print_stack()
E0602 09:45:07.674463 4695 flagvalues.py:399] Trying to access flag
verbosity before flags were parsed.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gflags/flagvalues.py", line
391, in __getattr__
raise exceptions.UnparsedFlagAccessError(error_message)
UnparsedFlagAccessError: Trying to access flag verbosity before
flags were parsed.
My code is as follows.
import gflags
import glog as log
I have searched online but haven't got any information about the python version of glog. I think this error has to do something with gflags and glog together. Can anyone please explain what is going wrong ?