|
@@ -159,13 +159,13 @@ from highest precedence to lowest.
|
|
|
interface, then the GRASS_PYTHON environment variable can be used to
|
|
|
override your system default <tt>python</tt> command.
|
|
|
|
|
|
-<p>Suppose for example your system has Python 2.6 installed and you
|
|
|
-install a personal version of the Python 2.7 binaries
|
|
|
+<p>Suppose for example your system has Python 3.6 installed and you
|
|
|
+install a personal version of the Python 3.7 binaries
|
|
|
under <tt>$HOME/bin</tt>. You can use the above variables to have
|
|
|
-GRASS use the Python 2.7 binaries instead.
|
|
|
+GRASS use the Python 3.7 binaries instead.
|
|
|
|
|
|
<div class="code"><pre>
|
|
|
- GRASS_PYTHON=python2.7
|
|
|
+ GRASS_PYTHON=python3.7
|
|
|
</pre></div>
|
|
|
|
|
|
<h3>Addon Path to Extra User Scripts</h3>
|
|
@@ -331,7 +331,7 @@ grass78 /path/to/grassdata/test1/PERMANENT/ --exec python test.py
|
|
|
A very simple Python script ("test.py") may look like this:
|
|
|
|
|
|
<div class="code"><pre>
|
|
|
-#!/usr/bin/env python
|
|
|
+#!/usr/bin/env python3
|
|
|
|
|
|
# import GRASS Python bindings (see also pygrass)
|
|
|
import grass.script as gscript
|
|
@@ -393,7 +393,7 @@ grass78 --tmp-location XY --exec r.neighbors --help
|
|
|
<h4>Troubleshooting</h4>
|
|
|
Importantly, to avoid an <tt>"[Errno 8] Exec format error"</tt> there must be a
|
|
|
<a href="https://en.wikipedia.org/wiki/Shebang_%28Unix%29">shebang</a> line at the top of
|
|
|
-the script (like <tt>#!/bin/sh</tt>, <tt>#!/bin/bash</tt>, or <tt>#!/usr/bin/env python</tt>)
|
|
|
+the script (like <tt>#!/bin/sh</tt>, <tt>#!/bin/bash</tt>, or <tt>#!/usr/bin/env python3</tt>)
|
|
|
indicating which interpreter to be used for the script. The script file must
|
|
|
have its executable bit set.
|
|
|
|
|
@@ -402,7 +402,7 @@ have its executable bit set.
|
|
|
If you start GRASS using the <em><a href="wxGUI.html">wxGUI</a></em>
|
|
|
interface you must have a <tt>python</tt> command in your $PATH
|
|
|
variable. That is, the command must be named
|
|
|
-<tt>python</tt> and not something like <tt>python2.6</tt>. Rarely some
|
|
|
+<tt>python</tt> and not something like <tt>python3.6</tt>. Rarely some
|
|
|
Python installations do not create a <tt>python</tt> command. In these
|
|
|
cases you can override <tt>python</tt> by GRASS_PYTHON environmental
|
|
|
variable.
|