Opened 16 years ago

Closed 7 years ago

#10539 closed Uncategorized (fixed)

Sphinx error: Could not import extension djangodocs, when running Sphinx >= 0.6

Reported by: Wiliam Alves de Souza Owned by: Karpuscul
Component: Documentation Version: dev
Severity: Normal Keywords: sphinx 0.6
Cc: wiliamsouza83@…, aribao@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

See error below:

waa@waa:~/svn/django/branches/release/1.0.X/docs$ make html

mkdir -p _build/html _build/doctrees
sphinx-build -b html -d _build/doctrees . _build/html
Running Sphinx v0.6b1
/home/waa/svn/django/branches/release/1.0.X/docs/_ext/djangodocs.py:9: DeprecationWarning: The sphinx.builder module is deprecated; please import builders from the respective sphinx.builders submodules.

import sphinx.builder

Extension error:
Could not import extension djangodocs (exception: No module named htmlwriter)
make: * [html] Error 1

Attachments (2)

10539-sphinx06-compatibility.diff (4.9 KB ) - added by Ramiro Morales 16 years ago.
sphinx.diff (4.2 KB ) - added by Simon Blanchard 16 years ago.

Download all attachments as: .zip

Change History (26)

comment:1 by Wiliam Alves de Souza, 16 years ago

Sphinx v0.6b1 is a beta version, the sphinx developers have planned to release its as a final version soon.

http://groups.google.com/group/sphinx-dev/browse_thread/thread/e00a453922c90b9a

comment:2 by Guilherme Gondim <semente@…>, 16 years ago

I have the same problem with Sphinx 0.6b1 on Ubuntu 8.10.

comment:3 by Jarek Zgoda, 16 years ago

Keywords: 0.6 added; v0.6b1 removed

Same error with Sphinx 0.6 final.

comment:4 by Ramiro Morales, 16 years ago

There is no pressing need to use Sphinx 0.6, 0.5 is supported and can be downloaded and used instead (0.5.2 was released the same day as 0.6) especially considering that Django documentation isn't exposing any Sphinx bug and it doesn't take advantages of new 0.6 features.

I have patches for the code problems, remaining problems seem to be template-related ones (Sphinx 0.6 introduces usage of Jinja 2). If/when I get around these without breaking compatibility with previous Sphinx versions, will upload a patch.

by Ramiro Morales, 16 years ago

comment:5 by Ramiro Morales, 16 years ago

Has patch: set
Owner: changed from nobody to Ramiro Morales

Attached patch implements changes that make it possible to build the documentation with Sphinx 0.6.1 and maintaining compatibility with Sphinx back to 0.4 (tested using make html with 0.4, 0.4.3, 0.5.2 and 0.6).

comment:6 by Wiliam Alves de Souza, 16 years ago

Owner: changed from Ramiro Morales to Wiliam Alves de Souza
Status: newassigned
Triage Stage: UnreviewedAccepted

Ramiro,
I can't apply this patch for tests propose if it not in svn diff format! or you can point me some technique to do that without edit the patch manually.

From http://docs.djangoproject.com/en/dev/internals/contributing/?from=olddocs:

Submit patches in the format returned by the svn diff command. An exception is for code changes that are described more clearly in plain English than in code. Indentation is the most common example; it’s hard to read patches when the only difference in code is that it’s indented.

comment:7 by Wiliam Alves de Souza, 16 years ago

Owner: changed from Wiliam Alves de Souza to Ramiro Morales
Status: assignednew

Ops!

in reply to:  6 ; comment:8 by Ramiro Morales, 16 years ago

Replying to waa:

... or you can point me some technique to do that without edit the patch manually.

Sure, just apply it with patch -p1, it's in Git diff format, generated from Mercurial:

$ ls
AUTHORS  django  docs  examples  extras  INSTALL  LICENSE  MANIFEST.in  README  scripts  setup.cfg  setup.py  tests
$ cat /path/to/10539-sphinx06-compatibility.diff | patch -p1
patching file docs/_ext/djangodocs.py
patching file docs/_templates/layout.html

From http://docs.djangoproject.com/en/dev/internals/contributing/?from=olddocs:

Submit patches in the format returned by the svn diff command. An exception is for code changes that are described more clearly in plain English than in code. Indentation is the most common example; it’s hard to read patches when the only difference in code is that it’s indented.

You forgot to cite the paragraph inmediately next:

Patches in git diff format are also acceptable.

in reply to:  8 comment:9 by Wiliam Alves de Souza, 16 years ago

Replying to ramiro:
...

Thanks for your attention!!!
I'm really forgot that :(

by Simon Blanchard, 16 years ago

Attachment: sphinx.diff added

comment:10 by Simon Blanchard, 16 years ago

Added alternative patch for latest sphinx

comment:11 by Malcolm Tredinnick, 16 years ago

The latest patch makes a bunch of what appear to be fairly unconditional (non version-dependent) changes. Has it been tested to run with earlier versions of Sphinx? Forcing everybody to upgrade to the latest version isn't cool.

comment:12 by Simon Blanchard, 16 years ago

Patch will break earlier Sphinx versions. Making it tepid?

comment:13 by Jannis Leidel, 16 years ago

Unless I'm completely blind the first patch does what the latest patch does without breaking old versions.

comment:14 by Ramiro Morales, 16 years ago

See also #10707

comment:15 by Karpuscul, 16 years ago

Owner: changed from Ramiro Morales to Karpuscul
Status: newassigned
Triage Stage: AcceptedReady for checkin

Guys,

Just now downloaded sphinx v0.6.1 (the latest official version at this moment), applied ramiro's patch using SVN-diff (just added indexing information to the file to do that), and tested. It works perfectly!

When will it be checked in? It is really needed if you want that users can built Django's documents locally.

Oleg Sakharov.

comment:16 by Dmitry Gladkov, 16 years ago

Thanks ramiro, works great on svn10755.

comment:17 by Adrian Ribao, 16 years ago

Cc: aribao@… added

comment:18 by Ramiro Morales, 16 years ago

Summary: Sphinx error: Could not import extension djangodocs, when running sphinx v0.6b1Sphinx error: Could not import extension djangodocs, when running Sphinx >= 0.6

comment:19 by Ryan, 16 years ago

As it stands, the documentation available at (http://docs.djangoproject.com/en/dev/internals/documentation/#internals-documentation) in regards to building the documentation locally is wrong. With the latest version of Sphinx available from easy_install (0.6.2 at the time of writing), running "make html" will cause it to exit with said error.

However after applying (10539-sphinx06-compatibility.diff), everything works perfectly (at least with Sphinx v0.6.2).

comment:20 by Eric Holscher, 15 years ago

milestone: 1.1

Just confirmed this, 1.1 shouldn't ship with broken docs.

comment:21 by Russell Keith-Magee, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [11162]) Fixed #10539 -- Updated Sphinx configuration to accommodate 0.6 while retaining compatibility with 0.4 and 0.5. Thanks to Ramiro Morales for the patch.

comment:22 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

comment:23 by andrei kulakov, 7 years ago

Easy pickings: unset
Resolution: fixed
Severity: Normal
Status: closednew
Type: Uncategorized
UI/UX: unset

I'm getting this error with current master branch and Sphinx 1.7.2:

make html
sphinx-build -b djangohtml -n -d _build/doctrees -D language= . _build/html
Running Sphinx v1.7.2
loading translations []... not available for built-in messages

Extension error:
Could not import extension djangodocs (exception: cannot import name 'SmartyPantsHTMLTranslator')
make: * [html] Error 2

comment:24 by Tim Graham, 7 years ago

Resolution: fixed
Status: newclosed

Please don't reopen such an old ticket that's been fixed. I can't reproduce your issue and the docs build on the CI server also works fine.

Note: See TracTickets for help on using tickets.
Back to Top