2

I installed gmsh but I can not use it in spyder. I used the following:

pip install gmsh
conda install -c conda-forge gmsh

but when I run the following code:

import gmsh
gmsh.initialize()

I get the following error:

No module named 'gmsh'

I'm using ubuntu 20.04 and spyder 3.3.6

  • Are you sure you've selected the correct interpreter for spyder? If you run `python -m pip freeze | grep gmsh`, do you see that package installed? Can you verify that `python -m pip -V` shows the same interpreter path as what you have selected in your IDE? – C.Nivs Feb 01 '22 at 20:43
  • If I simply `python -m pip install gmsh` and then run `python -c 'import gmsh'` I don't get any errors – C.Nivs Feb 01 '22 at 20:44
  • how do you run the code? – Axeltherabbit Aug 02 '22 at 13:23

1 Answers1

4

The gmsh package in conda-forge don't provide the Python API. Please install gmsh using pip install gmsh. If you still prefer to use conda, you can download the python-gmsh package from the conda-forge channel using conda install -c conda-forge gmsh python-gmsh. Here you will find the Python API you're looking for.