[Gmsh] Python API (with Anaconda)

paul francedixhuit paul18fr at gmail.com
Wed Mar 25 16:48:36 CET 2020


In fact a copy of the "gmsh.py" file was remaining in the working directory
and not pointing to the /lib one (a mistake); after removing it, now it
works fine using Spyder as described in my previous post; this way allows
me to run the API directly from Spyder.

Paul

Le mer. 25 mars 2020 à 15:23, paul francedixhuit <paul18fr at gmail.com> a
écrit :

> Hi All
>
> From scracth, I'm trying to use the gmsh Python API under Anaconda +
> spyder; I downloaded and installed the latest gmsh SDK release.
>
> Wherever I did (export PYTHONPATH in the .bashrc file or  path
> explicitly added in the python file, even running the API in commandline),
> I got the same following error.
>
> Is the mistake coming from my configuration? is the trouble coming from
> the Anaconda Python release? anything else?
>
> Thanks for any advice
>
> Paul
>
> ## add in the "t1.py" file
> import sys
> sys.path.append('/opt/gmsh_dev/lib')
> import gmsh
>
> ## Gmsh error
>   File "/home/paul/Gmsh/tutos/t1.py", line 13, in <module>
>     gmsh.initialize()
>
>   File "/home/paul/Gmsh/tutos/gmsh.py", line 197, in initialize
>     lib.gmshInitialize(
>
>   File "/opt/anaconda3/lib/python3.6/ctypes/__init__.py", line 361, in
> __getattr__
>     func = self.__getitem__(name)
>
>   File "/opt/anaconda3/lib/python3.6/ctypes/__init__.py", line 366, in
> __getitem__
>     func = self._FuncPtr((name_or_ordinal, self))
>
> AttributeError: /opt/anaconda3/bin/python: undefined symbol: gmshInitialize
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20200325/61e25c90/attachment.html>


More information about the gmsh mailing list