InvalidVersionSpecError when installing on Ubuntu 16.04

I’ve tried multiple paths of installing FEniCS including:

  • Ubuntu installation from Windows Store
  • Ubuntu on a virtual machine with virtual box

When I run :

conda config --add channels conda-forge
conda install fenics

I get the following error:
Solving environment: failed InvalidVersionSpecError: Invalid version spec: =2.7

Its not very descriptive, I imagine its some sort of compatibility issue but I have no clue how to find whats the problem. Both methods I’ve use a fresh install of Ubuntu.

When I run :

conda create -n fenicsproject -c conda-forge fenics

which is another instruction from the installation directions, it seems to work for a bit until it fails with the following error:

Executing transaction: failed
ERROR conda.core.link:_execute(507): An error occurred while installing package 'conda-forge::mpmath-1.2.1-pyhd8ed1ab_0'.
FileNotFoundError(2, "No such file or directory: '/home/jacob/anaconda3/envs/fenicsproject/bin/python3.8'")
Attempting to roll back.

Rolling back transaction: done

FileNotFoundError(2, "No such file or directory: '/home/jacob/anaconda3/envs/fenicsproject/bin/python3.8'")

So it seems something is wrong with mpmath? If I try to install that individually through conda it returns the same Spec version error earlier. Any solutions?

I can’t help with your conda installation, but why not use the fenics package that was built for Ubuntu?

Thanks for the quick response! I actually did try that as well, however when i try to import fenics or dolfin I get a ModuleNotFoundError. The installation seems to go find I just cant use the package. Do you have a solution for that by chance?

I just tried a different virtual machine without anaconda installed at all and it worked! do you how to import it in a jupyter notebook? That would probably require anaconda, right? Is it a conflict then?

No, in general jupyter does not need conda. conda is just a packaging environment. Since Ubuntu is already a packaging system, you’ll get conflcits if you try to mix conda and ubuntu packages in the same execution.

Jupyter may well need some configuration to know which python environment you’re aiming to work with. If you’re trying to use jupyter that was installed by conda, then that could explain conflicts accessing the Ubuntu python installation, since it would likely be configured to access the conda installation.

1 Like

ahh ok that all makes sense. I installed jupyter in my ubuntu distro seperatly and got it working, thanks!

1 Like