Maryam Jalili
Maryam Jalili

Reputation: 83

python - Can't use gmsh after installing via pip and conda

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

Upvotes: 5

Views: 4636

Answers (1)

estragiotti
estragiotti

Reputation: 61

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.

Upvotes: 6

Related Questions