'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



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source