[GRASS-dev] Issues with Sphinx on osgeo server

Vaclav Petras wenzeslaus at gmail.com
Fri Oct 3 13:54:26 PDT 2014


On Mon, Sep 29, 2014 at 7:11 AM, Markus Neteler <neteler at osgeo.org> wrote:

> Hi,
>
> recent changes broke the sphinx manual creation on grass.osgeo.org:
>
>
> # Sphinx version: 1.2b3
> # Python version: 2.6.6
> # Docutils version: 0.8.1 release
> # Jinja2 version: 2.6
> # Loaded extensions:
> Traceback (most recent call last):
>   File
> "/usr/local/lib/python2.6/dist-packages/Sphinx-1.2b3-py2.6.egg/sphinx/cmdline.py",
> line 245, in main
>     warningiserror, tags, verbosity, parallel)
>   File
> "/usr/local/lib/python2.6/dist-packages/Sphinx-1.2b3-py2.6.egg/sphinx/application.py",
> line 107, in __init__
>     confoverrides or {}, self.tags)
>   File
> "/usr/local/lib/python2.6/dist-packages/Sphinx-1.2b3-py2.6.egg/sphinx/config.py",
> line 229, in __init__
>     execfile_(filename, config)
>   File
> "/usr/local/lib/python2.6/dist-packages/Sphinx-1.2b3-py2.6.egg/sphinx/util/pycompat.py",
> line 93, in execfile_
>     exec code in _globals
>   File "conf.py", line 27, in <module>
>     from grass.script import core
> ImportError: No module named grass.script
>
> Both conf.py files and Sphinx itself requires import of packages/modules.
So the documentation build must run inside a valid GRASS session. conf.py
checks if GISBASE is set which is but it seems that Python path is not,
although the Makefile contains:

$(call run_grass,$(SPHINXBUILD) ...)

Does `call run_grass` sets PYTHONPATH? It seems that it does:

PYTHONPATH="$(GRASS_PYTHONPATH)"

It even seems that variable is set properly (although with the syntax I'm
never sure):

GRASS_PYTHONPATH := $(call mkpath,$(GISBASE)/gui/wxpython,$$PYTHONPATH)
GRASS_PYTHONPATH := $(call mkpath,$(GISBASE)/etc/python,$(GRASS_PYTHONPATH))

Any ideas why this no longer works? The cronjob is essentially
> untouched here as is the Debian box.
>
> I don't know on my computer it runs (outside of GRASS session). This
reminds me about the problem with toolboxes and some other things which
required GRASS session during compilation and were failing at some
platforms (Macs and Linux servers) for unknown reasons.

You can try to run inside GRASS session and also add `print sys.path`
before the import. The first will tell us if it is the same case as the
ones I mentioned. The second will tell us if PYTHONPATH is set correctly.

Now I'm wondering if the module is even there. Do you actually compile
GRASS or just the documentation?

Vaclav


Markus
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20141003/3d43e292/attachment.html>


More information about the grass-dev mailing list