Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8349551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:02:14+00:00 2026-06-09T08:02:14+00:00

I am trying to start documenting an small Python project with Sphinx. I created

  • 0

I am trying to start documenting an small Python project with Sphinx.

I created a samplecode.rst where I would try to organize (and auto-generate) the documentation for one of my classes (MyClass.py).

This is part of that samplecode.rst:

MyClass.py
----------------------------------
.. autoclass:: backlib.classes.MyClass
   :members:

But when I try to execute make html, I get an Import Error and the ‘MyClass‘ is not imported (showing an empty entry for ‘MyClass‘ in the generated .html):

Traceback (most recent call last):de                                                                                                                                                                                
  File "/usr/lib/pymodules/python2.7/sphinx/ext/autodoc.py", line 329, in import_object
    __import__(self.modname)
  File "/home/borrajax/Projects/myProject/backlib/classes/MyClass.py", line 4, in <module>
    from backlib.database import BaseClass
[ ... ]
    from grokcore.component import sort_components
ImportError: cannot import name sort_components

… and a bit later…

/home/borrajax/Projects/myProject/docs/source/samplecode.rst:16: (WARNING/2) autodoc can't import/find module 'backlib.classes.MyClass', it reported error: "cannot import name sort_components", please check your spelling and sys.path

/home/borrajax/Projects/myProject/docs/source/samplecode.rst:19: (WARNING/2) don't know which module to import for autodocumenting u'MyClass' (try placing a "module" or "currentmodule" directive in the document, or giving an explicit module name)

That grokcore thing that is messing up with my life is a module that gets installed in $HOME/.buildout/eggs/ and that I haven’t created nor I need to document.

I have added all the eggs found in $HOME/.buildout/eggs/ to the Pythonpath (in the Sphinx’s conf.py file) but that didn’t fix anything so now I’m trying a different approach (giving up) so here goes the question: Can I do something to skip this kind of errors?

I just want the comments in /home/borrajax/Projects/myProject/backlib/classes/MyClass.py to show in a pretty html page, that’s all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:02:16+00:00Added an answer on June 9, 2026 at 8:02 am

    Well… I found the issue.

    Mike Steder’s answer confirmed something that I had started suspecting by googling around: This type of ImporErrors in Sphinx are usually fairly trivial errors of some kind of misconfiguration. Nothing too intricate, so eventhough I had the directory where my source code was located in the sys.path (as Mike suggests in his answer), I started digging around.

    I commenced speculating that something I had done was messing up with the PythonPath, and the only thing I had actually done was adding the .eggs found in $HOME/.buildout/ through Sphinx’s conf.py file (so there had to be something wrong with that). I checked my $HOME/.buildout/ directory and realized that an update of the main Web Framework (Grok) used in this project had downloaded new versions of the .eggs to the $HOME/.buildout/ directory (causing most of the .eggs to have two versions). I removed completely the .buildout directory and reinstalled the Grok project (which downloaded the required .eggs, again, but now I don’t have multiple versions of the same .egg).

    And now, Sphinx’s make html creates a nice entry for my MyClass class 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to start a phantomjs process from python but for some reason it's
I am trying to start a new Rails project but I am getting a
I'm trying to start on a new project to help enrich my asp.net knowledge,
I'm trying to start using Unit Testing on my current project in Visual Studio
I am trying to start a new MVC project with tests and I thought
I'm trying to start python script with start-stop-daemon: sudo /sbin/start-stop-daemon --start --pidfile /home/loop.pid \
I'm trying to start using phing for deploying the project I'm working on. Until
When trying to start my JUnit-Test out of Eclipse, I get a ClassNotFoundException. When
i am trying to start the Program D from the terminal, command in terminal
I'm trying to start a Vagrant instance and getting the following message: Vagrant cannot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.