Installation issues with WSL

Hi everyone,
I am trying to get FEniCS installed in Windows, but nothing I have tried works.

We installed WSL for Windows, and checked that Python3 is installed. The Ubuntu version in WSL is 20.04

Then:

  • We tried the pip installation, but I have since discovered that this only works for 18.04 so this gives an error
  • We tried using
    sudo apt-get install fenics
    and this returns:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package fenics

This is the same error reported here and here for fenicsx

  • We tried using
sudo apt install fenics

which is also suggested in the links above, and we get the same error (Unable to locate package fenics)

  • Just in case, we tried doing the same with fenicsx but that returned the same errors

In terms of next steps, I know that Docker containers are an option (although I haven’t quite figured them out yet). Since they open files in a shared directory, does that mean that there could be issues if I performed computations with confidential data?

Is there anything else I can do to troubleshoot the installation in WSL?

I would really appreciate any advice on the matter.

Thank you!

Following: https://fenicsproject.org/download/archive/
you should call

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

Hi dokken,
Thank you for your quick response!

I tried that, and get the error

Cannot add PPA: 'ppa:~fenics-packages/ubuntu/fenics'.
ERROR: '~fenics-packages' user or team does not exist

This is how I started, and then following this post I learned that ppa is not the right way to do it with Ubuntu 20.04 (which is the Ubuntu version in WSL). Their suggested solutions are the ones that I explained in my post.

I have no issues calling the above command in a docker image based on ubuntu:20.0.
Maybe @dparsons has any additional tips?

Eh no, that post doesn’t say the ppa is wrong. It’s actually the other way around for 20.04. Ubuntu 20.04 (focal) doesn’t provide fenicsx from the official Ubuntu repository, so the PPA is the right place to get fenicsx for 20.04.

20.04 does provide old fenics (dolfin) though. As does the PPA (with a slightly newer version). Either should work for the fenics package.

Check that you have internet access from your WSL, e.g. check that ping ftp.dante.de responds.

For fenics, Instead of the fenics package (which is just a dependency wrapper), try installing the top-level components directly, e.g.

sudo apt install python3-mshr python3-dolfin

As for the PPA, your error message doesn’t match the PPA address. The url is ppa:fenics-packages/fenics but your error message refers to ppa:~fenics-packages/ubuntu/fenics. Can you confirm you used the command line exactly as dokken wrote here?

I also recommend running

sudo apt-get update
sudo apt-get upgrade

before running any of the commands to install fenics.

2 Likes

Hi both!
Thank you so much for your help. You’re right, I completely misunderstood the post that I tagged, and indeed ppa is the right way for ubuntu 20.04

I needed to run

sudo apt-get update
sudo apt-get upgrade

before the fenics installation, and it all worked out!

1 Like