[GRASS-user] wxPython cannot find installed module

On Mon, 1 May 2023, Anna Petrášová wrote:

The error comes from this:
from numpy import matrix

Is it possible you have different Python installations on your computer?
Try running a python shell from an active GRASS session and running the
import command and see what it gives you.

Anna,

Apparenly so. My Slackware64-15.0 includes python2-2.7.18, python3-3.9.10, and
python3-numpy-1.22.3. No python2-numpy.

Will GRASS be moving to Python3 some time?

Thanks,

Rich

You are likely using Python 3 already. Why don’t you try to see which one you use as I suggested?

On Mon, May 1, 2023 at 11:42 AM Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Mon, 1 May 2023, Anna Petrášová wrote:

The error comes from this:
from numpy import matrix

Is it possible you have different Python installations on your computer?
Try running a python shell from an active GRASS session and running the
import command and see what it gives you.

Anna,

Apparenly so. My Slackware64-15.0 includes python2-2.7.18, python3-3.9.10, and
python3-numpy-1.22.3. No python2-numpy.

Will GRASS be moving to Python3 some time?

Thanks,

Rich


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

On Mon, 1 May 2023, Anna Petrášová wrote:

You are likely using Python 3 already. Why don't you try to see which one
you use as I suggested?

Apparenly so. My Slackware64-15.0 includes python2-2.7.18,
python3-3.9.10, and python3-numpy-1.22.3. No python2-numpy.

Anna, As I wrote: python3-3.9.10 and python3-numpy-1.22.3 are installed,
along with python2 and the last python2-numpy.

Rich

When you run GRASS, go to terminal, type “python”, press Enter and look what the version of Python you use:

GRASS nc_spm_08_grass7/testpatch:~ > python
Python 3.8.10 (default, Mar 13 2023, 10:26:41)
[GCC 9.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import numpy as np
np.version.version
‘1.17.4’

or in the GUI, go to Python shell tab, look at the Python version, and try importing numpy

On Mon, May 1, 2023 at 12:43 PM Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Mon, 1 May 2023, Anna Petrášová wrote:

You are likely using Python 3 already. Why don’t you try to see which one
you use as I suggested?

Apparenly so. My Slackware64-15.0 includes python2-2.7.18,
python3-3.9.10, and python3-numpy-1.22.3. No python2-numpy.

Anna, As I wrote: python3-3.9.10 and python3-numpy-1.22.3 are installed,
along with python2 and the last python2-numpy.

Rich


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

On Mon, 1 May 2023, Anna Petrášová wrote:

When you run GRASS, go to terminal, type "python", press Enter and look
what the version of Python you use:

Anna,

It's the 2.7.18 version. Is there a configuration file in which I can
specify python3?

Regards,

Rich

There is GRASS_PYTHON:
https://grass.osgeo.org/grass82/manuals/variables.html

But I have never used it myself. Note that we don’t support Python 2 anymore.

On Mon, May 1, 2023 at 1:42 PM Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Mon, 1 May 2023, Anna Petrášová wrote:

When you run GRASS, go to terminal, type “python”, press Enter and look
what the version of Python you use:

Anna,

It’s the 2.7.18 version. Is there a configuration file in which I can
specify python3?

Regards,

Rich


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

On Mon, 1 May 2023, Anna Petrášová wrote:

There is GRASS_PYTHON:
https://grass.osgeo.org/grass82/manuals/variables.html

But I have never used it myself. Note that we don't support Python 2
anymore.

Anna,

Then I wonder why this clean 15.0 installation on the ThinkPad didn't
automatically use python3. Guess I'll add the environmenal variable to my
.bash_profile.

Thanks,

Rich

You may want to change the default Python on your system.

On Mon, May 1, 2023 at 2:14 PM Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Mon, 1 May 2023, Anna Petrášová wrote:

There is GRASS_PYTHON:
https://grass.osgeo.org/grass82/manuals/variables.html

But I have never used it myself. Note that we don’t support Python 2
anymore.

Anna,

Then I wonder why this clean 15.0 installation on the ThinkPad didn’t
automatically use python3. Guess I’ll add the environmenal variable to my
.bash_profile.

Thanks,

Rich


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user