[Qgis-user] PY QGIS crashing when using numpy

Fernando M. Roxo da Motta petro at roxo.org
Mon Feb 26 13:03:39 PST 2018


On Mon, 26 Feb 2018 19:48:28 +0100, Giacomo Fontanelli
<giacomofontanelli76 at gmail.com> wrote:


> Hi forum
> 
> each time I try to write a code using the numpy library, qgis crashes
> and quits, so I can't geyt any relevant information about my error.
> This happen when I use qgis 2.18.16 in Lubuntu 16.04.
> 
> For example, if I try to run this very small script
> 
> import numpy as np
> from osgeo import gdal
> 
> ds = gdal.Open("/home/giacomo/Dropbox/Linux/VHVV.tif")
> myarray = np.array(ds.GetRasterBand(1).ReadAsArray()
> 
> Qgis quits.

  I have tried this code on Xubuntu 16.04, same Ubuntu version than
yours, and worked fine.

3 >>> import numpy as np
4 >>> from osgeo import gdal
5 >>> ds = gdal.Open("/home/roxo/Petra.tif")
6 >>> myarray = np.array(ds.GetRasterBand(1).ReadAsArray())
7

  From Qgis/Help/About:


Versão do QGIS  2.18.16
Código da versão do QGIS  d473c30
Compilado sobre Qt 4.8.7
Rodando sobre Qt 4.8.7
Compilado sobre GDAL/OGR 1.11.3
Rodando sobre GDAL/OGR 1.11.3
Compilado sobre GEOS 3.5.0-CAPI-1.9.0
Rodando sobre GEOS 3.5.0-CAPI-1.9.0 r4084
Versão do cliente PostgreSQL 9.5.2
Versão SpatiaLite 4.3.0a
Versão do QWT 5.2.3
Versão PROJ.4 492
Versão QScintilla2 2.9.1

$ dpkg -l|grep numpy
ii  python-numpy  1:1.11.0-1ubuntu1 amd64 
ii  python3-numpy 1:1.11.0-1ubuntu1 amd64 

  Hope this helps.


> 
> The strange thing is that it doesn't happen when I launch the same
> script in QGIS 2.18.15 in Windows 10.
> 
> Any help
> 
> Thank you








  Roxo

-- 
---------------- Non luctari, ludare -------------------+ WYSIWYG
Fernando M. Roxo da Motta <petro at roxo.org>              | Editor?
Except where explicitly stated I speak on my own behalf.|  VI !!
      ( Usuário Linux registrado #39505 )               | I see text,
------------ Quis custodiet ipsos custodes?-------------+ I get text!
 



More information about the Qgis-user mailing list