# No module named 'dolfin.cpp'

**URL:** https://fenicsproject.discourse.group/t/no-module-named-dolfin-cpp/8634
**Category:** Uncategorized
**Created:** [June 27, 2022, 7:54pm UTC](https://fenicsproject.discourse.group/t/no-module-named-dolfin-cpp/8634 "2022-06-27T19:54:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tareqath](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@tareqath](https://fenicsproject.discourse.group/u/tareqath)
#### Post date: [June 27, 2022, 7:54pm UTC](https://fenicsproject.discourse.group/t/no-module-named-dolfin-cpp/8634/1 "2022-06-27T19:54:14Z")

</div>

Hello, I’m trying to use FeniCS but I’m getting the error

`No module named 'dolfin.cpp'`

This error first appeared after reinstalling FeniCS, and appears also when installing it on google colab. Here’s the entire error log:

```auto
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-ad1b407335d7> in <module>()
     39 # Begin demo
     40 
---> 41 from dolfin import *
     42 
     43 # Source term

/usr/lib/petsc/lib/python3/dist-packages/dolfin/ __init__.py in <module>()
     32 
     33 # Import cpp modules
---> 34 from .cpp import __version__
     35 
     36 from .cpp.common import (Variable, has_debug, has_hdf5, has_scotch,

ModuleNotFoundError: No module named 'dolfin.cpp'

```

Anyone know any solution ? Thanks.

---

<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: [June 27, 2022, 9:12pm UTC](https://fenicsproject.discourse.group/t/no-module-named-dolfin-cpp/8634/2 "2022-06-27T21:12:21Z")

</div>

My guess is that you’re using an Ubuntu installation, and there’s a mismatch with the versions that your dolfin is built against.

If dolfin is found and it’s just cpp that’s missing, then the problem will be your python version. You can see which python it’s been compiled against from the version tags in the cpp files in /usr/lib/petsc/lib/python3/dist-packages/dolfin/. The Ubuntu python packages are built against the python versions that are provided by the given Ubuntu release.

Google colab is not properly maintained by the way. Google has [not been able](https://github.com/googlecolab/colabtools/issues/1880) to update it past ubuntu 18.04, which only supports python3.6. Most packages today need python3.8 or later. A work-around is available at [https://fem-on-colab.github.io/](https://fem-on-colab.github.io/)

---

<div class="post-metadata">

### Author: ![tareqath](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@tareqath](https://fenicsproject.discourse.group/u/tareqath)
#### Post date: [June 27, 2022, 10:14pm UTC](https://fenicsproject.discourse.group/t/no-module-named-dolfin-cpp/8634/3 "2022-06-27T22:14:07Z")

</div>

Thank you for your prompt reply. I’m indeed using Ubuntu, 18.04 to be precise. I will get back to you once I’ve explored and tinkered with the versions and installations I have.
