# Basix, ufl and ffcx not found on docker image dolfinx\_mpc:v0.10.0

**URL:** <https://fenicsproject.discourse.group/t/basix-ufl-and-ffcx-not-found-on-docker-image-dolfinx-mpc-v0-10-0/18460>\
**Category:** installation\
**Created:** [December 10, 2025, 3:58pm UTC](https://fenicsproject.discourse.group/t/basix-ufl-and-ffcx-not-found-on-docker-image-dolfinx-mpc-v0-10-0/18460 "2025-12-10T15:58:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JvLuenen](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@JvLuenen](https://fenicsproject.discourse.group/u/JvLuenen)\
**Post date:** [December 10, 2025, 3:58pm UTC](https://fenicsproject.discourse.group/t/basix-ufl-and-ffcx-not-found-on-docker-image-dolfinx-mpc-v0-10-0/18460/1 "2025-12-10T15:58:31Z")

</div>

I’ve been messing around all day to get the docker image of dolfinx\_mpc:v0.10.0 to work but so far without luck.

Currently my Dockerfile is:

```bash
FROM ghcr.io/jorgensd/dolfinx_mpc:v0.10.0
#FROM dolfinx/dev-env:v0.10.0

# Install curl and ca-certificates
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates

# Download and install UV
ADD https://astral.sh/uv/install.sh /uv-installer.sh
RUN sh /uv-installer.sh && rm /uv-installer.sh
ENV PATH="/root/.local/bin/:$PATH"

# Install GraphViz
RUN apt-get install graphviz

# Set working directory
WORKDIR /workspace

# Copy project metadata
COPY pyproject.toml .
COPY uv.lock .

# Install packages in virtual environment
ENV UV_ENV="/dolfinx-env"        
ENV UV_NO_VENV=1                  
RUN uv sync --all-extras --active

```

Whenever I try to run any simple code which uses dolfinx, I run into the issue that basix, ufl, and ffcx are not installed on the container. Installing them via UV (or pip) creates new issues and I’m fairly sure this is not needed.

Could anyone shed some light on what I am doing wrong?

```bash
import dolfinx.fem
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/dolfinx-real/lib/python3.12/dist-packages/dolfinx/ __init__.py", line 32, in <module>
    from dolfinx import fem, geometry, graph, io, jit, la, log, mesh, nls, plot
  File "/usr/local/dolfinx-real/lib/python3.12/dist-packages/dolfinx/fem/ __init__.py", line 23, in <module>
    from dolfinx.fem.assemble import (
  File "/usr/local/dolfinx-real/lib/python3.12/dist-packages/dolfinx/fem/assemble.py", line 24, in <module>
    from dolfinx.fem.bcs import DirichletBC
  File "/usr/local/dolfinx-real/lib/python3.12/dist-packages/dolfinx/fem/bcs.py", line 20, in <module>
    from dolfinx.fem.function import Constant, Function, FunctionSpace
  File "/usr/local/dolfinx-real/lib/python3.12/dist-packages/dolfinx/fem/function.py", line 18, in <module>
    import basix
ModuleNotFoundError: No module named 'basix'

```

---

<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 10, 2025, 7:16pm UTC](https://fenicsproject.discourse.group/t/basix-ufl-and-ffcx-not-found-on-docker-image-dolfinx-mpc-v0-10-0/18460/2 "2025-12-10T19:16:02Z")

</div>

This surely has to do with your `uv` setup, as removing the last lines of your dockerfile and running:

```python

FROM ghcr.io/jorgensd/dolfinx_mpc:v0.10.0
#FROM dolfinx/dev-env:v0.10.0

# Install curl and ca-certificates
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates

# Download and install UV
ADD https://astral.sh/uv/install.sh /uv-installer.sh
RUN sh /uv-installer.sh && rm /uv-installer.sh
ENV PATH="/root/.local/bin/:$PATH"

# Install GraphViz
RUN apt-get install graphviz

# Set working directory
WORKDIR /workspace

```

works fine, i.e. `python3 -c "import dolfinx; import basix"` works.

Further, if you run:

```bash
python3 -c "import dolfinx; print(dolfinx); import dolfinx_mpc; print(dolfinx_mpc); import basix; print(basix); import ufl; print(ufl)"

```

you’ll get

```bash
<module 'dolfinx' from '/usr/local/dolfinx-real/lib/python3.12/dist-packages/dolfinx/ __init__.py'>
<module 'dolfinx_mpc' from '/usr/local/dolfinx-real/lib/python3.12/dist-packages/dolfinx_mpc/ __init__.py'>
<module 'basix' from '/dolfinx-env/lib/python3.12/site-packages/basix/ __init__.py'>
<module 'ufl' from '/dolfinx-env/lib/python3.12/site-packages/ufl/ __init__.py'>

```

which points you to the locations where the packages are installed.

I am not sure why youo set `UV_ENV` adnd `UV_NO_VENV`, as it seems like just using the already set `VIRTUAL_ENV` variable it should install packages in the right place.  
For instance:

```docker
FROM ghcr.io/jorgensd/dolfinx_mpc:v0.10.0
#FROM dolfinx/dev-env:v0.10.0

# Install curl and ca-certificates
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates

# Download and install UV
ADD https://astral.sh/uv/install.sh /uv-installer.sh
RUN sh /uv-installer.sh && rm /uv-installer.sh
ENV PATH="/root/.local/bin/:$PATH"

# Install GraphViz
RUN apt-get install graphviz

# Set working directory
WORKDIR /workspace

RUN uv pip install pyvista

```

works and install pyvista, while still being able to import dolfinx, basix, ufl etc.

---

<div class="post-metadata">

**Author:** ![JvLuenen](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@JvLuenen](https://fenicsproject.discourse.group/u/JvLuenen)\
**Post date:** [December 11, 2025, 9:49am UTC](https://fenicsproject.discourse.group/t/basix-ufl-and-ffcx-not-found-on-docker-image-dolfinx-mpc-v0-10-0/18460/3 "2025-12-11T09:49:47Z")

</div>

Alright, well that solves it. Thanks!
