Python - No handlers could be found for logger "OpenGL.error"

PythonLoggingOpenglWxpythonPyopengl

Python Problem Overview


Okay, what is it, and why does it occur on Win2003 server, but not on WinXP.

It doesn't seem to affect my application at all, but I get this error message when I close the application. And it's annoying (as errors messages should be).

I am using pyOpenGl and wxPython to do the graphics stuff. Unfortunately, I'm a C# programmer that has taken over this Python app, and I had to learn Python to do it.

I can supply code and version numbers etc, but I'm still learning the technical stuff, so any help would be appreciated.

Python 2.5, wxPython and pyOpenGL

Python Solutions


Solution 1 - Python

Looks like OpenGL is trying to report some error on Win2003, however you've not configured your system where to output logging info.

You can add the following to the beginning of your program and you'll see details of the error in stderr.

import logging
logging.basicConfig()

Checkout documentation on logging module to get more config info, conceptually it's similar to log4J.

Solution 2 - Python

The proper way to get rid of this message is to configure NullHandler for the root level logger of your library (OpenGL).

Solution 3 - Python

After adding the Logging above, I was able to see that the problem was caused by missing TConstants class, which I was excluding in the py2exe setup.py file.

After removing the "Tconstants" from the excluded list, I no longer had problems.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPaige WatsonView Question on Stackoverflow
Solution 1 - PythonKozyarchukView Answer on Stackoverflow
Solution 2 - Pythonanatoly techtonikView Answer on Stackoverflow
Solution 3 - PythonPaige WatsonView Answer on Stackoverflow