# Should \`basix' load \`dolfinx\`by default?

**URL:** https://fenicsproject.discourse.group/t/should-basix-load-dolfinx-by-default/12920
**Category:** Errors
**Created:** [December 2, 2023, 9:20pm UTC](https://fenicsproject.discourse.group/t/should-basix-load-dolfinx-by-default/12920 "2023-12-02T21:20:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![edgar](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@edgar](https://fenicsproject.discourse.group/u/edgar)
#### Post date: [December 2, 2023, 9:20pm UTC](https://fenicsproject.discourse.group/t/should-basix-load-dolfinx-by-default/12920/1 "2023-12-02T21:20:28Z")

</div>

Hello.

# Description of the issue

The Python API of Basix fails when trying to access `basix.ufl` if DOLFINx is not loaded.

# Expected result

I would not have expected Basix to depend on DOLFINx to work with UFL. If that is the case, may be Basix should load DOLFINx by default.

# MWE

```python
import basix
import ufl
# import dolfinx # uncomment to fix error

basix.ufl

```

## Error output

```auto
Traceback (most recent call last):
  File "<stdin>", line 6, in <module>
AttributeError: module 'basix' has no attribute 'ufl'

```

# System

- FEniCSx software  
dolfinx: 0.8.0.dev0\_r27568.a34b0c9-1  
basix: 0.8.0.dev0\_r952.eebbc52-1  
ufl: 2023.3.0.dev0\_r3568.f132188-1  
ffcx: 0.8.0.dev0\_r7083.b4cb217-1

- Dependencies  
python: 3.11.5-2  
python-numpy: 1.26.0-1  
petsc: 3.19.5.1171.g37df9106526-1  
hdf5-openmpi: 1.14.2-1  
boost: 1.83.0-2  
adios2: 2.8.3-5  
scotch: 7.0.4-1  
pybind11: 2.11.1-1  
python-build: 1.0.1-1  
python-cffi: 1.15.1-4  
python-cppimport: 22.08.02.r6.g0849d17-1  
python-installer: 0.7.0-3  
python-mpi4py: 3.1.4-3  
python-pytest: 7.4.2-1  
python-scikit-build: 0.17.6-1  
python-setuptools: 1:68.0.0-1  
python-wheel: 0.40.0-3  
xtensor: 0.24.0-2  
xtensor-blas: 0.20.0-1

- Operating system  
Arch Linux: 6.5.4-arch2-1

---

<div class="post-metadata">

### Author: ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)
#### Post date: [December 2, 2023, 11:19pm UTC](https://fenicsproject.discourse.group/t/should-basix-load-dolfinx-by-default/12920/2 "2023-12-02T23:19:32Z")

</div>

`basix.ufl` is an optional submodule of Basix.  
You should import it explicitly through `import basix.ufl`
