# No module named 'dolfin' Ubuntu 18.04 bionic

**URL:** <https://fenicsproject.discourse.group/t/no-module-named-dolfin-ubuntu-18-04-bionic/5312>\
**Category:** installation\
**Created:** [March 15, 2021, 8:27am UTC](https://fenicsproject.discourse.group/t/no-module-named-dolfin-ubuntu-18-04-bionic/5312 "2021-03-15T08:27:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniele](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@daniele](https://fenicsproject.discourse.group/u/daniele)\
**Post date:** [March 15, 2021, 8:27am UTC](https://fenicsproject.discourse.group/t/no-module-named-dolfin-ubuntu-18-04-bionic/5312/1 "2021-03-15T08:27:38Z")

</div>

Hi,  
the latest update to 2019.2.0.5~ppa1~bionic1 broke my FEniCS installation. Now I can’t import dolfin anymore. Am I the only one experiencing this?

Thanks in advance for any help!

---

<div class="post-metadata">

**Author:** ![dparsons](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dparsons](https://fenicsproject.discourse.group/u/dparsons)\
**Post date:** [March 15, 2021, 11:48am UTC](https://fenicsproject.discourse.group/t/no-module-named-dolfin-ubuntu-18-04-bionic/5312/2 "2021-03-15T11:48:34Z")

</div>

It’s been reported by others. I’m looking into it.

---

<div class="post-metadata">

**Author:** ![dparsons](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dparsons](https://fenicsproject.discourse.group/u/dparsons)\
**Post date:** [March 15, 2021, 12:14pm UTC](https://fenicsproject.discourse.group/t/no-module-named-dolfin-ubuntu-18-04-bionic/5312/3 "2021-03-15T12:14:58Z")

</div>

Ubuntu 18.04 bionic had a poor way of managing PETSc alternatives which was later improved. If you’re in a position to upgrade to Ubuntu 20.04 then I recommend doing that.

In the meantime, as a workaround you can get dolfin back by explicitly setting PETSC\_DIR,

```auto
$ PETSC_DIR=/usr/lib/petscdir/petsc3.7/x86_64-linux-gnu-real/ python3 -c "import dolfin; print(dolfin. __version__ ); print(dolfin. __path__ )"
2019.2.0.dev0
['/usr/lib/petscdir/petsc3.7/x86_64-linux-gnu-real/lib/python3/dist-packages/dolfin']

```

---

<div class="post-metadata">

**Author:** ![dparsons](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dparsons](https://fenicsproject.discourse.group/u/dparsons)\
**Post date:** [March 15, 2021, 4:14pm UTC](https://fenicsproject.discourse.group/t/no-module-named-dolfin-ubuntu-18-04-bionic/5312/4 "2021-03-15T16:14:46Z")

</div>

It’s fixed now in the PPA. The problem was that Ubuntu bionic used an overly complicated path for PETSC\_DIR, which interfered with backporting the latest DOLFIN release…

---

<div class="post-metadata">

**Author:** ![daniele](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@daniele](https://fenicsproject.discourse.group/u/daniele)\
**Post date:** [March 15, 2021, 4:30pm UTC](https://fenicsproject.discourse.group/t/no-module-named-dolfin-ubuntu-18-04-bionic/5312/5 "2021-03-15T16:30:31Z")

</div>

Thanks a lot! This was super fast and super efficient. I can confirm that it’s working for me.
