[GRASS-user] Using grass.script in Jupyter (Azure)

Vaclav Petras wenzeslaus at gmail.com
Fri Oct 19 13:39:49 PDT 2018


On Sat, Oct 13, 2018 at 9:09 PM Mehrdad Varedi <varedi at gmail.com> wrote:
>
> ImportError                               Traceback (most recent call
last)
> <ipython-input-3-cd30798f91ed> in <module>()
> ----> 1 import grass.script as gs
>       2 import grass.script.setup as gsetup
>
>
f:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.4.1\etc\python\grass\script\__init__.py
in <module>()
>       3 from __future__ import absolute_import
>       4
> ----> 5 from .core   import *
>       6 from .db     import *
>       7 from .raster import *
>
>
f:\PROGRA~1\QGIS2~1.18\apps\grass\grass-7.4.1\etc\python\grass\script\core.py
in <module>()
>      42     # python3
>      43     import builtins as __builtin__
> ---> 44     from os import environb as environ
>      45     unicode = str
>      46 __builtin__.__dict__['_'] =
__builtin__.__dict__['_'].__self__.lgettext
>
> ImportError: cannot import name 'environb' from 'os'
(f:\ProgramData\Anaconda3\lib\os.py)

You are trying to run it in Python 3 which is the first part of the
traceback (that is actually fine if you want to run it in Python 3 - but
note that the support is experimental).

As for the error itself, environb is a part of os in Python 3, so I don't
understand why that would be missing in your Anaconda Python. You can check
the files manually and confirm that all is an expected Python version.

https://docs.python.org/3/library/os.html#os.environb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20181019/2164b932/attachment.html>


More information about the grass-user mailing list