Problems in installing FEniCS using Ubuntu PPA , Anaconda and stable version

1,046 views
Skip to first unread message

Dong Ivan

unread,
Sep 8, 2018, 12:19:45 AM9/8/18
to fenics-support
Dear developers of FEniCS,
        I want to use FEniCS as a numerical experiment tool to study finite element exterior calculus. And I've tried to install FEniCS in several ways. But all have bugs reported. I use Ubuntu 16.04.5 LTS 64bit and Anaconda5.2 python 3.6 version.
        First I tried:
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt-get update
sudo apt-get install --no-install-recommends fenics
        Though no errors are reported, when I typed "python -c 'import FEniCS', it returned No module named 'fenics'.
        I also used Anaconda:
conda create -n fenicsproject -c conda-forge fenics
source activate fenicsproject
        Again, no errors are reported, when I tried to run fenics-tutorial, for example "python ft01_poisson.py", it was said that name 'interactive' is not defined. And when I tried to run 'python ft02_poisson_membrane.py', it was said 'No module named mshr' And when I tried to run 'python ft02_heat.py', it was returned: object has no attribute 'array'.
        I also tried install the stable version using:
pip3 install fenics-ffc --upgrade
FENICS_VERSION=$(python3 -c"import ffc; print(ffc.__version__)")
git clone --branch=$FENICS_VERSION https://bitbucket.org/fenics-project/dolfin
git clone --branch=$FENICS_VERSION https://bitbucket.org/fenics-project/mshr
mkdir dolfin/build && cd dolfin/build && cmake .. && make install && cd ../..
mkdir mshr/build   && cd mshr/build   && cmake .. && make install && cd ../..
cd dolfin/python && pip3 install . && cd ../..
cd mshr/python   && pip3 install . && cd ../..
        But error happened when installing mshr:
  Could not find a version that satisfies the requirement fenics-dolfin (from mshr===2018.1.0) (from versions: )
No matching distribution found for fenics-dolfin (from mshr===2018.1.0)
        I checked Slack but still no answers were founded.
        Could you tell me how can I successfully install FEniCS? Do I need to add some environment variables or install some missing components?
        I send again using a different email because my last email has been bounded back. So I don't know whether the email has been received.
Best regards!
Yifan

Johannes Ring

unread,
Sep 10, 2018, 4:05:26 AM9/10/18
to Dong Ivan, fenics-support
On Sat, Sep 8, 2018 at 6:19 AM, Dong Ivan <einseg...@gmail.com> wrote:
Dear developers of FEniCS,
        I want to use FEniCS as a numerical experiment tool to study finite element exterior calculus. And I've tried to install FEniCS in several ways. But all have bugs reported. I use Ubuntu 16.04.5 LTS 64bit and Anaconda5.2 python 3.6 version.
        First I tried:
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt-get update
sudo apt-get install --no-install-recommends fenics
        Though no errors are reported, when I typed "python -c 'import FEniCS', it returned No module named 'fenics'.

The packages from the PPA does not work together with Anaconda because they don't use the same Python interpreter. Normally, using the PPA is the easiest and the recommended way of installing FEniCS on Ubuntu, but the PPA for Ubuntu 16.04 does not include the latest FEniCS release, so in your case it might be better to use the conda packages.
 
        I also used Anaconda:
conda create -n fenicsproject -c conda-forge fenics
source activate fenicsproject
        Again, no errors are reported, when I tried to run fenics-tutorial, for example "python ft01_poisson.py", it was said that name 'interactive' is not defined.

This is because the tutorial is not up-to-date with the latest FEniCS release (the 'interactive' keyword has been removed). Try running some of the demo programs for FEniCS 2018.1.0 instead (https://fenicsproject.org/docs/dolfin/2018.1.0/python/demos.html).
 
And when I tried to run 'python ft02_poisson_membrane.py', it was said 'No module named mshr'

When using Anaconda you need to install the mshr package in addition to the fenics package:

  source activate fenicsproject
  conda install -c conda-forge mshr
 
And when I tried to run 'python ft02_heat.py', it was returned: object has no attribute 'array'.

Replace `.array()` with `.get_local()`.
 
        I also tried install the stable version using:
pip3 install fenics-ffc --upgrade
FENICS_VERSION=$(python3 -c"import ffc; print(ffc.__version__)")
git clone --branch=$FENICS_VERSION https://bitbucket.org/fenics-project/dolfin
git clone --branch=$FENICS_VERSION https://bitbucket.org/fenics-project/mshr
mkdir dolfin/build && cd dolfin/build && cmake .. && make install && cd ../..
mkdir mshr/build   && cd mshr/build   && cmake .. && make install && cd ../..
cd dolfin/python && pip3 install . && cd ../..
cd mshr/python   && pip3 install . && cd ../..
        But error happened when installing mshr:
  Could not find a version that satisfies the requirement fenics-dolfin (from mshr===2018.1.0) (from versions: )
No matching distribution found for fenics-dolfin (from mshr===2018.1.0)

I would avoid installing from source unless there is a specific reason you need it. Try instead to get the Anaconda installation running first.

Johannes
 
        I checked Slack but still no answers were founded.
        Could you tell me how can I successfully install FEniCS? Do I need to add some environment variables or install some missing components?
        I send again using a different email because my last email has been bounded back. So I don't know whether the email has been received.
Best regards!
Yifan

--
You received this message because you are subscribed to the Google Groups "fenics-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fenics-support+unsubscribe@googlegroups.com.
To post to this group, send email to fenics-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fenics-support/8b3fac9b-2965-4860-9f5b-65dcefacf935%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages