AttributeError: module 'dolfin' has no attribute 'SLEPcEigenSolver'

Dear fenics community,

I am trying to use SLEPcEigenSolver but I get an error

AttributeError: module ‘dolfin’ has no attribute ‘SLEPcEigenSolver’

For example, running these python commands I get (I show below version of PETSc4py and SLEPc4py and DOLFIN)

Python 3.8.14 (default, Sep 16 2022, 11:07:26) 
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dolfin as dl
>>> dl.SLEPcEigenSolver
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'dolfin' has no attribute 'SLEPcEigenSolver'
>>> dl.__version__
'2019.1.0'
>>> import slepc4py
>>> slepc4py.__version__
'3.15.2'
>>> import petsc4py
>>> petsc4py.__version__
'3.15.5' 

Any ideas on how to solve this is really appropriated. Many thanks!

How have you installed DOLFIN? SLEPc is an optional dependency. If you compiled it from source it likely didn’t find your SLEPc installation.

Thank you @nate for your help. I did not install DOLFIN myself, I am using it in a cluster where it is already packaged in a module. I then use

module load <module_name>

to have it installed in my environment.

I would check with your cluster administration to see if DOLFIN was configured and compiled with SLEPc.

1 Like

Thank you @nate for the help! I will try that.