No module named 'dolfin'

Hi, I’m new to FEniCS
I installed FEniCS on my ubuntu 16.04 LTS from the Ubuntu PPA and it works finely. However, when I tried to run the demo file, it returned this message:
ModuleNotFoundError: No module named 'dolfin'

I have Anaconda 4.4.0 with Python 3.6.1 installed on my system before I installed fenics. I also tried to install fenics using conda but it returned this message:
UnsatisfiableError: The following specifications were found to be in conflict:
- fenics

note: I didn’t upgrade my Anaconda because the last time I update it, I got errors everywhere and even I couldn’t import numpy

Can you elaborate a bit more on how did you install (and which version of) FEniCS ? Also, what do you mean by it works finely ? Specifically, if you are using both python and python3 on your system it is a good idea to create a virtual environment (either conda or python3-venv) for FEniCS and install all dependencies within it.

Hi,
I’m sorry, what I meant by “it works finely” is the installation process didn’t encounter any error. I installed fenics 2019.1 by using the following commands:

sudo apt-get install --no-install-recommends software-properties-common
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt-get update
sudo apt-get install --no-install-recommends fenics

If I create a virtual environment using conda and install fenics, the version that installed is version 2016 if I’m not mistaken, and it automatically installed Python 2.7. If I’m using fenics 2016, can I use Python 3.6 instead of 2.7?

Try running

python3 -c "from dolfin import *"

If this runs fine then you are good to go using python3 and instead of python as I’m assuming that your system python is still python2 (it only got updated to python3 in 18.04 ).

Can you try echo-ing the path to python3 using

which python3 

I think that is due to both conda and system python being installed on your system. It is very much possible, and I have myself verified, to break the numpy installation by updating packages naively. I can provide some help with installing a fresh conda distribution consistently, but the best way forward it to check the above paths first.