Hello,
I’m new to Ubuntu and Fenics.
I recently installed Ubuntu and got it to run Jupyter Notebook, but getting the following import error when I tried to run the test code. Could anyone give detailed instruction on how to solve this problem?
Thanks,
ImportError Traceback (most recent call last)
Cell In[1], line 12
1 ‘’’
2 Test code
3
(…)
9 @author: xxxx
10 ‘’’
—> 12 from fenics import *
13 from math import exp, tanh
14 import matplotlib.pyplot as plt
File /usr/lib/python3/dist-packages/fenics/init.py:7
1 # -- coding: utf-8 --
2 “”“Main module for FEniCS.
3
4 This module is identical with the main DOLFIN module.
5 “””
----> 7 from dolfin import *
File /usr/lib/petsc/lib/python3/dist-packages/dolfin/init.py:138
136 from . import la
137 from . import mesh
→ 138 from . import parameter
140 from .common import timer
141 from .common.timer import Timer, timed
File /usr/lib/petsc/lib/python3/dist-packages/dolfin/parameter/init.py:11
4 # Copyright (C) 2017 Chris N. Richardson and Garth N. Wells
5 #
6 # Distributed under the terms of the GNU Lesser Public License (LGPL),
7 # either version 3 of the License, or (at your option) any later
8 # version.
10 import dolfin.cpp as cpp
—> 11 from ffc import default_jit_parameters
12 from dolfin.cpp.parameter import parameters, Parameters
15 # Extend cpp.Parameters with a getitem method
File ~/.local/lib/python3.8/site-packages/ffc/init.py:24
21 from ffc.git_commit_hash import git_commit_hash
23 # Import compiler functions
—> 24 from ffc.compiler import compile_form, compile_element
26 # Import JIT compiler
27 from ffc.jitcompiler import jit
File ~/.local/lib/python3.8/site-packages/ffc/compiler.py:129
127 from ffc.representation import compute_ir
128 from ffc.optimization import optimize_ir
→ 129 from ffc.codegeneration import generate_code
130 from ffc.formatting import format_code
131 from ffc.wrappers import generate_wrapper_code
File ~/.local/lib/python3.8/site-packages/ffc/codegeneration.py:37
34 # FFC code generation modules
35 from ffc.representation import pick_representation, ufc_integral_types
—> 37 import ffc.uflacs.language.cnodes as L
38 from ffc.uflacs.language.format_lines import format_indented_lines
39 from ffc.uflacs.backends.ufc.utils import generate_error
File ~/.local/lib/python3.8/site-packages/ffc/uflacs/init.py:23
19 “”“This is UFLACS, the UFL Analyser and Compiler System.”“”
21 author = u"Martin Sandve Alnæs"
—> 23 from ffc.uflacs.uflacsrepresentation import compute_integral_ir
24 from ffc.uflacs.uflacsoptimization import optimize_integral_ir
25 from ffc.uflacs.uflacsgenerator import generate_integral_code
File ~/.local/lib/python3.8/site-packages/ffc/uflacs/uflacsrepresentation.py:26
23 from ufl import custom_integral_types
25 from ffc.log import info
—> 26 from ffc.representationutils import initialize_integral_ir
27 from ffc.fiatinterface import create_element
28 from ffc.uflacs.tools import collect_quadrature_rules, compute_quadrature_rules, accumulate_integrals
File ~/.local/lib/python3.8/site-packages/ffc/representationutils.py:28
25 import numpy
27 from ufl.measure import integral_type_to_measure_name, point_integral_types, facet_integral_types, custom_integral_types
—> 28 from ufl.cell import cellname2facetname
30 from ffc.log import error
31 from ffc.fiatinterface import create_element
ImportError: cannot import name ‘cellname2facetname’ from ‘ufl.cell’ (/usr/lib/python3/dist-packages/ufl/cell.py)