Dear Christophe, Thank you for your assistance.
I have downloaded the last snapshot of the SDK from http://gmsh.info/ (downloaded file : http://gmsh.info/bin/Linux/gmsh-git-Linux64-sdk.tgz ), extracted the files from the archive and copy the folder gmsh-git-Linux64-sdk to the python3.6/site-package repository. The segmentation fault no longer occurs when the demo script t1.py is running. Good news! Regarding the second mistake, I think I have gotten rid of it after an extra operation. In the Ubuntu settings, I set the regional format to "English (United Kingdom)" ("Display numbers, dates and currency amounts in the usual format for: " in the package Language Support). Previously, the choice was "Français". I thought I had already deleted this trace of French settings. To conclude, I should use this snapshot of the SDK and then version 4.5 when it will be released, is that correct? Best regards, Baptiste Durand --- Baptiste Durand Doctorant – Laboratoire Navier baptiste.dur...@enpc.fr – 01 64 15 37 21 ( 06 58 88 05 41 ) – linkedin.com/in/baptistedurand De: cgeuza...@uliege.be À: "Baptiste DURAND" <baptiste.dur...@enpc.fr> Cc: gmsh@onelab.info Envoyé: Vendredi 25 Octobre 2019 13:33:46 Objet: Re: [Gmsh] Gmsh Pyhon API + matplotlib cause unreadable msh files and Segmentation fault Can you try a recent snapshot of the SDK and let us know if it fixes the issue (which IIRC was due to statically linking the standard C++ lib)? Thanks, Christophe Le 25 oct. 2019 à 12:30, Baptiste DURAND <baptiste.dur...@enpc.fr> a écrit : BQ_BEGIN Dear all, I'm used to using gmsh through the python API, on Ubuntu 18.04. With the version 4.4 of gmsh , I am faced with an unwanted behaviour when I try to import both gmsh and matplotlib into the same script. Firstly, if matplotlib is imported before gmsh , a Segmentation fault error occurs. Steps to reproduce this : * Create a new virtual environment : * Activate this environment : * Install wheels : pip3 install wheels * Install gmsh python API using the gmsh -sdk package on pypi.org : pip3 install gmsh -sdk * Install the matplotlib package : pip3 install matplotlib * Add the line "import matplotlib" before "import gmsh " in the demo script t1.py * Run this demo script in the virtual environment : python3 t1.py This results in : Segmentation fault (core dumped) If matplotlib is not imported or is imported after gmsh this segmentation fault doesn't occur. In addition, if include-system-site-packages is set to true in the configuration file of the virtual environment (pyvenv.cfg) another problem appears. I need this setting because I would like to use the FEniCS finite element code and it cannot be installed inside a virtual environment. Even if matplotlib is imported after gmsh , the resulting mesh file is unreadable because the decimal separator is a comma. Has anyone faced a similar issue ? Best regards, Baptiste Durand --- Baptiste Durand Doctorant – Laboratoire Navier baptiste.dur...@enpc.fr – 01 64 15 37 21 ( 06 58 88 05 41 ) – linkedin.com/in/baptistedurand <t1_with_matplotlib.py> _______________________________________________ gmsh mailing list gmsh@onelab.info http://onelab.info/mailman/listinfo/gmsh BQ_END
_______________________________________________ gmsh mailing list gmsh@onelab.info http://onelab.info/mailman/listinfo/gmsh