I tested on 2.18.16 and your code works Probably a conflicts on GDAL versions? btw You are not using any pyqgis call that can conflicts.
YOu can start trying to execute the commands line by line and discover what command crash qgis... and check also if gdal.__version__ values match that listed in qgis help->about just y 2c Luigi Pirelli ************************************************************************************************** * LinkedIn: https://www.linkedin.com/in/luigipirelli * Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli * GitHub: https://github.com/luipir * Mastering QGIS 2nd Edition: * https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition * Hire me: http://goo.gl/BYRQKg ************************************************************************************************** On 26 February 2018 at 18:48, Giacomo Fontanelli <giacomofontanell...@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. > > 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 > > _______________________________________________ > Qgis-user mailing list > Qgis-user@lists.osgeo.org > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user _______________________________________________ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user