Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building docs: Could not import extension sphinxext.math_symbol_table (exception: No module named math_symbol_table) #2228

Closed
dpsanders opened this issue Jul 18, 2013 · 17 comments

Comments

@dpsanders
Copy link

When I run
python make.py html
I get

Extension error:
Could not import extension sphinxext.math_symbol_table (exception: No module named math_symbol_table)

This is the first time this has happened (I successfully built the docs before). Any suggestions for what is going on?

@mdboom
Copy link
Member

mdboom commented Jul 18, 2013

The math_symbol_table.py file is supposed to be in doc/sphinxext/ in the matplotlib tree. Is it there?

Can you paste the complete error -- or the error log that sphinx puts in /tmp -- it's hard to say what might be going on here.

@dpsanders
Copy link
Author

The math_symbol_table.py file is in doc/sphinxext/, yes

The complete output is:

python make.py html
Running Sphinx v1.2b1

Extension error:
Could not import extension sphinxext.math_symbol_table (exception: No
module named math_symbol_table)
Building HTML failed.

There is nothing in /tmp

On Thu, Jul 18, 2013 at 8:47 AM, Michael Droettboom <
notifications@github.com> wrote:

The math_symbol_table.py file is supposed to be in doc/sphinxext/ in the
matplotlib tree. Is it there?

Can you paste the complete error -- or the error log that sphinx puts in
/tmp -- it's hard to say what might be going on here.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2228#issuecomment-21184211
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

@mdboom
Copy link
Member

mdboom commented Jul 18, 2013

Very puzzling. And you're building the docs from within the doc directory?

@dpsanders
Copy link
Author

I just did a fresh clone of my fork.

I followed the instructions (which are now quite explicit ;) ) in
doc/README.rst
to build the docs from within the doc directory, and get exactly the same
error message.

Running from within doc
ls sphinxext/
gives
__init__.py gen_rst.py math_symbol_table.py gen_gallery.py github.py

I take it that nobody else has this problem?
Could it be a corrupt sphinx or something?

On Thu, Jul 18, 2013 at 10:50 AM, Michael Droettboom <
notifications@github.com> wrote:

Very puzzling. And you're building the docs from within the doc directory?


Reply to this email directly or view it on GitHubhttps://github.com//issues/2228#issuecomment-21193273
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

@mdboom
Copy link
Member

mdboom commented Jul 18, 2013

The only thing I can think of is this. In conf.py, we explicitly add the current directory to sys.path so that these extensions can be found. (This is actually standard procedure for a Sphinx document -- I think sphinx-quickstart even put it there). My wild guess is that somehow that is failing, due to some interaction with some other tool that is managing sys.path, such as setuptools or virtualenv etc. If you could find a way to print out sys.path right before this error occurs, that might give some clues, but given that Sphinx is not giving us a traceback here, I'm not even sure where to begin recommending you put it.

@dpsanders
Copy link
Author

On Thu, Jul 18, 2013 at 11:27 AM, Michael Droettboom <
notifications@github.com> wrote:

The only thing I can think of is this. In conf.py, we explicitly add the
current directory to sys.path so that these extensions can be found.
(This is actually standard procedure for a Sphinx document -- I think
sphinx-quickstart even put it there). My wild guess is that somehow that
is failing, due to some interaction with some other tool that is managing
sys.path, such as setuptools or virtualenv etc. If you could find a way to
print out sys.path right before this error occurs, that might give some
clues, but given that Sphinx is not giving us a traceback here, I'm not
even sure where to begin recommending you put it.

Here is the pdb traceback. Does that help at all?

%tb

SystemExit Traceback (most recent call last)
/Users/dsanders/development/ipython/IPython/utils/py3compat.pyc in
execfile(fname, *where)
202 else:
203 filename = fname
--> 204 builtin.execfile(filename, *where)

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py in ()
247 raise SystemExit('Do not know how to handle %s; valid
args are %s'%(
248 arg, funcd.keys()))
--> 249 func()
250 else:
251 small_docs = False

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py in html()
144 options = ''
145 if os.system('sphinx-build %s -b html -d build/doctrees .
build/html' % options):
--> 146 raise SystemExit("Building HTML failed.")
147
148 figures_dest_path = 'build/html/pyplots'

SystemExit: Building HTML failed.

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py(146)html()
145 if os.system('sphinx-build %s -b html -d build/doctrees .
build/html' % options):
--> 146 raise SystemExit("Building HTML failed.")
147


Reply to this email directly or view it on GitHubhttps://github.com//issues/2228#issuecomment-21195921
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

@dpsanders
Copy link
Author

I am printing out arg and func and everything seems fine...

On Thu, Jul 18, 2013 at 11:57 AM, David P. Sanders dpsanders@gmail.comwrote:

On Thu, Jul 18, 2013 at 11:27 AM, Michael Droettboom <
notifications@github.com> wrote:

The only thing I can think of is this. In conf.py, we explicitly add the
current directory to sys.path so that these extensions can be found.
(This is actually standard procedure for a Sphinx document -- I think
sphinx-quickstart even put it there). My wild guess is that somehow that
is failing, due to some interaction with some other tool that is managing
sys.path, such as setuptools or virtualenv etc. If you could find a way to
print out sys.path right before this error occurs, that might give some
clues, but given that Sphinx is not giving us a traceback here, I'm not
even sure where to begin recommending you put it.

Here is the pdb traceback. Does that help at all?

%tb

SystemExit Traceback (most recent call last)
/Users/dsanders/development/ipython/IPython/utils/py3compat.pyc in
execfile(fname, *where)
202 else:
203 filename = fname
--> 204 builtin.execfile(filename, *where)

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py in ()
247 raise SystemExit('Do not know how to handle %s; valid
args are %s'%(
248 arg, funcd.keys()))
--> 249 func()
250 else:
251 small_docs = False

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py in html()
144 options = ''
145 if os.system('sphinx-build %s -b html -d build/doctrees .
build/html' % options):
--> 146 raise SystemExit("Building HTML failed.")
147
148 figures_dest_path = 'build/html/pyplots'

SystemExit: Building HTML failed.

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py(146)html()
145 if os.system('sphinx-build %s -b html -d build/doctrees .
build/html' % options):
--> 146 raise SystemExit("Building HTML failed.")
147


Reply to this email directly or view it on GitHubhttps://github.com//issues/2228#issuecomment-21195921
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

@WeatherGod
Copy link
Member

Don't run the doc build from ipython. IPython likes to get its hooks into
everything. Building the docs straight from a regular python call (python
make.py) should work fine.

@dpsanders
Copy link
Author

Hi Michael,

I have isolated the error, but do not understand it:
If I put the full pathname to sphinx-build and run it myself from the
terminal, then it works...

Does this make any sense to you?

Thanks and best wishes,
David.

PS: Thanks for your kind, gentle and helpful behaviour to newbies at the
sprint. I now feel like slightly less of a newbie and hopefully will be
contributing something useful soon. If I can just get the damn thing to
compile...!

On Thu, Jul 18, 2013 at 12:04 PM, David P. Sanders dpsanders@gmail.comwrote:

I am printing out arg and func and everything seems fine...

On Thu, Jul 18, 2013 at 11:57 AM, David P. Sanders dpsanders@gmail.comwrote:

On Thu, Jul 18, 2013 at 11:27 AM, Michael Droettboom <
notifications@github.com> wrote:

The only thing I can think of is this. In conf.py, we explicitly add
the current directory to sys.path so that these extensions can be
found. (This is actually standard procedure for a Sphinx document -- I
think sphinx-quickstart even put it there). My wild guess is that
somehow that is failing, due to some interaction with some other tool that
is managing sys.path, such as setuptools or virtualenv etc. If you could
find a way to print out sys.path right before this error occurs, that
might give some clues, but given that Sphinx is not giving us a traceback
here, I'm not even sure where to begin recommending you put it.

Here is the pdb traceback. Does that help at all?

%tb


SystemExit Traceback (most recent call
last)
/Users/dsanders/development/ipython/IPython/utils/py3compat.pyc in
execfile(fname, *where)
202 else:
203 filename = fname
--> 204 builtin.execfile(filename, *where)

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py in
()
247 raise SystemExit('Do not know how to handle %s; valid
args are %s'%(
248 arg, funcd.keys()))
--> 249 func()
250 else:
251 small_docs = False

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py in html()
144 options = ''
145 if os.system('sphinx-build %s -b html -d build/doctrees .
build/html' % options):
--> 146 raise SystemExit("Building HTML failed.")
147
148 figures_dest_path = 'build/html/pyplots'

SystemExit: Building HTML failed.

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py(146)html()
145 if os.system('sphinx-build %s -b html -d build/doctrees .
build/html' % options):
--> 146 raise SystemExit("Building HTML failed.")
147


Reply to this email directly or view it on GitHubhttps://github.com//issues/2228#issuecomment-21195921
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

@dpsanders
Copy link
Author

This is getting ridiculous: it turns out that I do have to run
sphinx-build from within ipython to get it to work. I seem to have some
mess with paths. Is there any way to find out what's wrong?

On Thu, Jul 18, 2013 at 12:17 PM, David P. Sanders dpsanders@gmail.comwrote:

Hi Michael,

I have isolated the error, but do not understand it:
If I put the full pathname to sphinx-build and run it myself from the
terminal, then it works...

Does this make any sense to you?

Thanks and best wishes,
David.

PS: Thanks for your kind, gentle and helpful behaviour to newbies at the
sprint. I now feel like slightly less of a newbie and hopefully will be
contributing something useful soon. If I can just get the damn thing to
compile...!

On Thu, Jul 18, 2013 at 12:04 PM, David P. Sanders dpsanders@gmail.comwrote:

I am printing out arg and func and everything seems fine...

On Thu, Jul 18, 2013 at 11:57 AM, David P. Sanders dpsanders@gmail.comwrote:

On Thu, Jul 18, 2013 at 11:27 AM, Michael Droettboom <
notifications@github.com> wrote:

The only thing I can think of is this. In conf.py, we explicitly add
the current directory to sys.path so that these extensions can be
found. (This is actually standard procedure for a Sphinx document -- I
think sphinx-quickstart even put it there). My wild guess is that
somehow that is failing, due to some interaction with some other tool that
is managing sys.path, such as setuptools or virtualenv etc. If you could
find a way to print out sys.path right before this error occurs, that
might give some clues, but given that Sphinx is not giving us a traceback
here, I'm not even sure where to begin recommending you put it.

Here is the pdb traceback. Does that help at all?

%tb


SystemExit Traceback (most recent call
last)
/Users/dsanders/development/ipython/IPython/utils/py3compat.pyc in
execfile(fname, *where)
202 else:
203 filename = fname
--> 204 builtin.execfile(filename, *where)

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py in
()
247 raise SystemExit('Do not know how to handle %s;
valid args are %s'%(
248 arg, funcd.keys()))
--> 249 func()
250 else:
251 small_docs = False

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py in html()
144 options = ''
145 if os.system('sphinx-build %s -b html -d build/doctrees .
build/html' % options):
--> 146 raise SystemExit("Building HTML failed.")
147
148 figures_dest_path = 'build/html/pyplots'

SystemExit: Building HTML failed.

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py(146)html()
145 if os.system('sphinx-build %s -b html -d build/doctrees .
build/html' % options):
--> 146 raise SystemExit("Building HTML failed.")
147


Reply to this email directly or view it on GitHubhttps://github.com//issues/2228#issuecomment-21195921
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

@dpsanders
Copy link
Author

Success!!

On Thu, Jul 18, 2013 at 12:22 PM, David P. Sanders dpsanders@gmail.comwrote:

This is getting ridiculous: it turns out that I do have to run
sphinx-build from within ipython to get it to work. I seem to have some
mess with paths. Is there any way to find out what's wrong?

On Thu, Jul 18, 2013 at 12:17 PM, David P. Sanders dpsanders@gmail.comwrote:

Hi Michael,

I have isolated the error, but do not understand it:
If I put the full pathname to sphinx-build and run it myself from the
terminal, then it works...

Does this make any sense to you?

Thanks and best wishes,
David.

PS: Thanks for your kind, gentle and helpful behaviour to newbies at the
sprint. I now feel like slightly less of a newbie and hopefully will be
contributing something useful soon. If I can just get the damn thing to
compile...!

On Thu, Jul 18, 2013 at 12:04 PM, David P. Sanders dpsanders@gmail.comwrote:

I am printing out arg and func and everything seems fine...

On Thu, Jul 18, 2013 at 11:57 AM, David P. Sanders dpsanders@gmail.comwrote:

On Thu, Jul 18, 2013 at 11:27 AM, Michael Droettboom <
notifications@github.com> wrote:

The only thing I can think of is this. In conf.py, we explicitly add
the current directory to sys.path so that these extensions can be
found. (This is actually standard procedure for a Sphinx document -- I
think sphinx-quickstart even put it there). My wild guess is that
somehow that is failing, due to some interaction with some other tool that
is managing sys.path, such as setuptools or virtualenv etc. If you could
find a way to print out sys.path right before this error occurs, that
might give some clues, but given that Sphinx is not giving us a traceback
here, I'm not even sure where to begin recommending you put it.

Here is the pdb traceback. Does that help at all?

%tb


SystemExit Traceback (most recent call
last)
/Users/dsanders/development/ipython/IPython/utils/py3compat.pyc in
execfile(fname, *where)
202 else:
203 filename = fname
--> 204 builtin.execfile(filename, *where)

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py in
()
247 raise SystemExit('Do not know how to handle %s;
valid args are %s'%(
248 arg, funcd.keys()))
--> 249 func()
250 else:
251 small_docs = False

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py in html()
144 options = ''
145 if os.system('sphinx-build %s -b html -d build/doctrees .
build/html' % options):
--> 146 raise SystemExit("Building HTML failed.")
147
148 figures_dest_path = 'build/html/pyplots'

SystemExit: Building HTML failed.

/Users/dsanders/development/matplotlib/matplotlib/doc/make.py(146)html()
145 if os.system('sphinx-build %s -b html -d build/doctrees .
build/html' % options):
--> 146 raise SystemExit("Building HTML failed.")
147


Reply to this email directly or view it on GitHubhttps://github.com//issues/2228#issuecomment-21195921
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

@NelleV
Copy link
Member

NelleV commented Jul 19, 2013

Can you confirm we can close this issue?

@dpsanders
Copy link
Author

Well, the issue still exists and I did not find out the cause, but there is
a kludgy solution and it doesn't actually affect the ability to compile the
docs, i.e. is not a failure of the build process per se, so I guess we can
close it for now.

However, it does break the process described in the README.rst, so it would
be very nice to get to the bottom of it...

On Fri, Jul 19, 2013 at 3:25 AM, Varoquaux notifications@github.com wrote:

Can you confirm we can close this issue?


Reply to this email directly or view it on GitHubhttps://github.com//issues/2228#issuecomment-21237553
.

Dr. David P. Sanders

Profesor Titular "A" / Associate Professor
Departamento de Física, Facultad de Ciencias
Universidad Nacional Autónoma de México (UNAM)

dpsanders@gmail.com
http://sistemas.fciencias.unam.mx/~dsanders

Cubículo / office: #414, 4o. piso del Depto. de Física

Tel.: +52 55 5622 4965

@mdboom
Copy link
Member

mdboom commented Jul 19, 2013

@dpsanders: What was the kludgy solution?

@dpsanders
Copy link
Author

@mdboom
The kludgy solution was to run sphinx-build, from within IPython, with working directory doc , with explicit path, and by hand:

%run /usr/local/bin/sphinx-build -b html -d build/doctrees . build/html !

In fact, this is the key line that make.py executes.

@dpsanders
Copy link
Author

This seems to have resolved itself: I can now run python make.py again. (The html option is the default.)

Ready to be closed.

@tacaswell
Copy link
Member

Closing as @dpsanders asked for it to be 7 months ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants