Forum Message



We have moved the forum to . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.


The forum is in read only mode.

ngsxfem installation problem

10 months 3 weeks ago #4734 by Antoine

I am trying to use ngsxfem but I have a problem with the installation.

I am on Ubuntu 22.04.2 and I have installed NGSolve-6.2.2302.
I am running NGSolve using a virtual environment:
python3 -m venv ngvirtual

Then I installed ngsxfem using:
pip3 install xfem

Running from the demos in ngsxfem I get the following error:

Traceback (most recent call last):
  File "/home/antoine/ngsolve/", line 66, in <module>
    from xfem import *
  File "/home/antoine/ngsolve/ngvirtual/lib/python3.10/site-packages/xfem/", line 23, in <module>
    from xfem.ngsxfem_py import *        
ImportError: cannot open shared object file: No such file or directory

Indeed I can find the file but not

Any idea on how I should proceed to solve this problem? Thank you.

10 months 3 weeks ago #4735 by hvwahl
Replied by hvwahl on topic ngsxfem installation problem
Hi Antoine,

it looks like you have a different mkl version compared to the one used to build the binaries for pypi. The quickest solution is probably for you to build ngsxfem from sources locally. If you have installed cmake and git, this should be doable just with the command 

pip3 install git+

Otherwise, checkout the  instructions to build from the sources here .

Best wishes,
10 months 3 weeks ago - 10 months 3 weeks ago #4736 by schruste
Alternatively you could try if installing ngsolve and mkl through pip helps (both recent versions should be compatible with ngsxfem).

Last edit: 10 months 3 weeks ago by schruste.
10 months 3 weeks ago #4738 by Antoine

Thank you. I tried to install mkl through pip and it was installing mkl 2022.2.1. The latest version of mkl is 2023.1.0, so I installed it but then I get the following message: 

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
ngsolve 6.2.2302 requires mkl==2022.*, but you have mkl 2023.1.0 which is incompatible.

Is it the correct version of ngsolve?

I think I will try to install from source then.


Time to create page: 0.101 seconds