This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

No module named dolfin on ubuntu 14.10

0 votes

Hi all,
I have installed fenics on my ubuntu 14.10 operating system and can check from the Ubuntu Software Centre that Fenics is installed, but when I import dolfin from the terminal I get the following error.

Python 2.7.10 |Anaconda 2.1.0 (32-bit)| (default, Oct 19 2015, 18:04:40) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> from dolfin import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named dolfin

Please how can I resolve this. Thank you.

asked Nov 21, 2015 by Vivian FEniCS Novice (550 points)

I'm not sure you can use the packages with Anaconda, but you should make sure you use the packages from the FEniCS PPA. Since you are running Ubuntu 14.10, you will have to use FEniCS 1.4 since this is the only version available for that version of Ubuntu. However, I would recommend that you upgrade to Ubuntu 15.04. You can find the FEniCS 1.4 packages for Ubuntu 14.10 in this PPA.

Also not that GCC 4.4 will not work with FEniCS.

When you installed Anaconda, you in fact installed a complete python distribution parallel to your system default one. When you use the software center to install, FEniCS will be installed with respect to your system default. In your terminal, try

/usr/bin/python
>>>import dolfin

And you will probably get another error, as mentioned in the comment above. You can either:

  1. Use the correct PPA for your operating system, as mentioned above, and use your system python distribution.
  2. Upgrade to a more recent version of ubuntu.
  3. If you want to use Anaconda: install FEniCS using the conda package manager:
    http://fenicsproject.org/download/installation_using_conda.html#installation-using-conda
...