We are documenting our Python*3* code with Sphinx. We are using tkinter. We 
were getting an error that the module could not be imported. We installed 
python-mock and then added to the conf.py:

import mock
MOCK_MODULES = ['tkinter']
for mod_name in MOCK_MODULES:
    sys.modules[mod_name] = mock.Mock()

This nearly solved the problem. The one place it did not solve the problem 
was when we are using tkinter classes for inheritance. For example: 

class FrameScrollbar(tkinter.Frame):

These are ignored (no warning, no error)- the documentation is not 
included. If we change it to:

class FrameScrollbar(Tkinter.Frame):

Then the Sphinx brings in the documentation without a problem. The capital 
T in Tkinter signifies Python2. 

We have tried to adjust the sys.path in the conf.py so it will look to 
Python3 for tkinter, but have not had success.

We've searched on the web but do not see this error address, which makes us 
think there is a common solution which we've not found. Would you be able 
to help us on this?

Thank you,
Anthony 



-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to