Anaconda Installation of Fenics and Mshr

Then that just begs the question of why mshr would be included in the apt-get but not in the

conda install -c conda-forge fenics


But I still need to know if

conda install -n fenicsproject -c conda-forge mshr=2019.1.0

would default to the last build or if I need to somehow find out what the build differences are and specify a particular one, e.g.

conda install -n fenicsproject -c conda-forge mshr=2019.1.0=py38h255090a_2

As the fenics project is an open source project, it is dependent on people maintaining instructions. As no of the main developers has limited experience with conda, it has not been prioritized.

Any contributions to the conda packages are welcome.

@dparsons has been kind and maintained the fenics apt-packages.

I would like to note that mshr is no longer maintained, it is now recommended to use external meshing software, see: How i can make geometry and mesh in my program? - #2 by dokken for a list of suggested mesh generators.

Thanks Jorgen @dokken,

It appears on cursory views that these external meshing software do not have the pre-defined shapes that mshr had. Plus, one of my co-workers recommended meshio, which is not directly mentioned in the comparison.

How non-functional is mshr? Essentially, is it still sufficient for most FE problems (or at least the tutorial codes) to install the last build of mshr for my machine (? I’m fairly certain it is py39h9761ab4_4 but I still don’t know where to look for the info on what is different between builds)?

I am just starting to use FEniCS, so I am totally willing to help update the conda documentation for getting a functional install.

Meshio is not a meshing tool, but a mesh converter (between a large variety of formats).

Mshr works with its current functionality, but there is no one maintaining it. This means that if you find bugs the likelyhood of anyone fixing them is quite slim. I do not know much about the different mshr versions on conda, as I stopped using it many years ago.

So, even if I do get a working version of mshr, I will need to install meshio (conda install -c conda-forge meshio) and probably an overall external meshing program (like pygmsh) for future work. Okay.

At any rate, Where do I go to find out the differences between the builds for the various modules?

As mshr creates dolfin meshes, you do not need meshio. But it is needed for any other external meshing software.

If you are talking about the conda module builds, I honestly do not know, maybe @sebastkm knows, as he used conda.

Dear Kristin,

just a quick remark from my side: I only had to specify the build in conda, because the default build did not work. Just importing anything from mshr caused the ImportErrors listed above.

I think the build problem was fixed recently. When I tried to create a fresh conda environment with fenics and mshr (for python 3.7) today, it just worked without specifying any version or build id.

Best regards
Martin (L)

1 Like

My mshr does work, I installed with just using mshr and not specifying anything with an =… so I agree, the build problem must have been fixed, a big “thanks” to whomever did that!!!

Dear MartinLenz,
Your proposed method is impeccable. Thank you so much.

I had to reinstall FEniCS2019 and I tried to install every newer versions of mshr with fenics but they did not work properly. So with ubuntu 22.04, if you want to install mshr and fenics with conda, the command is still
conda install -c conda-forge fenics mshr=2019.1.0=py38h255090a_2

Dear All,
I just started to install fenics and I am struggling with a lot of problems. I couldn’t install fenics on anaconda to use it on jupyter notebook. I tried everything I found on the net but they didn’t work. Can someone please help me? I am using mac. here is the list I could install. (I could install fenics with pip but its not with conda so I can’t import it on jupyter notebook).

Name Version Build Channel

_r-mutex 1.0.1 anacondar_1 conda-forge
aiohttp 3.8.4 py310h2aa6e3c_1 conda-forge
aiosignal 1.3.1 pyhd8ed1ab_0 conda-forge
anyio 3.7.0 pyhd8ed1ab_1 conda-forge
aom 3.5.0 h7ea286d_0 conda-forge
appnope 0.1.3 pyhd8ed1ab_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py310h8e9501a_3 conda-forge
asttokens 2.2.1 pyhd8ed1ab_0 conda-forge
async-timeout 4.0.2 pyhd8ed1ab_0 conda-forge
attrs 23.1.0 pyh71513ae_1 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 pyhd8ed1ab_3 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.12.2 pyha770c72_0 conda-forge
bleach 6.0.0 pyhd8ed1ab_0 conda-forge
blosc 1.21.4 hc338f07_0 conda-forge
boost-cpp 1.78.0 h9ed8d21_3 conda-forge
brotli 1.0.9 h1a8c8d9_8 conda-forge
brotli-bin 1.0.9 h1a8c8d9_8 conda-forge
bwidget 1.9.14 hce30654_1 conda-forge
bzip2 1.0.8 h3422bc3_4 conda-forge
c-ares 1.19.1 hb547adb_0 conda-forge
ca-certificates 2023.5.7 hf0a4a13_0 conda-forge
cairo 1.16.0 h1e71087_1016 conda-forge
cctools_osx-arm64 973.0.1 hef52d2f_13 conda-forge
certifi 2023.5.7 pyhd8ed1ab_0 conda-forge
cffi 1.15.1 py310h2399d43_3 conda-forge
charset-normalizer 3.1.0 pyhd8ed1ab_0 conda-forge
clang 14.0.6 hca03da5_1
clang-14 14.0.6 default_h1b80db6_1
clang_osx-arm64 14.0.6 h15773ab_6 conda-forge
clangxx 14.0.6 default_h1b80db6_1
clangxx_osx-arm64 14.0.6 he29aa18_6 conda-forge
comm 0.1.3 pyhd8ed1ab_0 conda-forge
compiler-rt 14.0.6 h4ccfd99_0
compiler-rt_osx-arm64 14.0.6 h4fb70ea_0
contourpy 1.0.7 py310h2887b22_0 conda-forge
curl 8.1.2 h912dcd9_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
debugpy 1.6.7 py310h0f1eb42_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
double-conversion 3.2.0 hb7217d7_1 conda-forge
eigen 3.4.0 hc021e02_0 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
exceptiongroup 1.1.1 pyhd8ed1ab_0 conda-forge
executing 1.2.0 pyhd8ed1ab_0 conda-forge
expat 2.5.0 hb7217d7_1 conda-forge
fenics 2019.1.0 pypi_0 pypi
fenics-basix 0.7.0.dev0 pypi_0 pypi
fenics-dijitso 2019.1.0 pypi_0 pypi
fenics-dolfinx 0.6.0 py310habe3afa_101 conda-forge
fenics-ffc 2019.1.0.post0 pypi_0 pypi
fenics-ffcx 0.6.0 pyh56297ac_0 conda-forge
fenics-fiat 2019.1.0 pypi_0 pypi
fenics-libbasix 0.6.0 hf081368_0 conda-forge
fenics-libdolfinx 0.6.0 h9d5e15a_101 conda-forge
fenics-ufcx 0.6.0 h56297ac_0 conda-forge
fenics-ufl 2019.1.0 pypi_0 pypi
ffmpeg 5.1.2 gpl_hb9565b2_107 conda-forge
fftw 3.3.10 mpi_mpich_h0cb5807_7 conda-forge
flit-core 3.9.0 pyhd8ed1ab_0 conda-forge
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 hab24e00_0 conda-forge
fontconfig 2.14.2 h82840c6_0 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.40.0 py310h2aa6e3c_0 conda-forge
freetype 2.12.1 hd633e50_1 conda-forge
fribidi 1.0.10 h27ca646_0 conda-forge
frozenlist 1.3.3 py310h8e9501a_0 conda-forge
gettext 0.21.1 h0186832_0 conda-forge
gfortran_impl_osx-arm64 11.3.0 h1977daa_28
gfortran_osx-arm64 11.3.0 h57527a5_1 conda-forge
gl2ps 1.4.2 h17b34a0_0 conda-forge
glew 2.1.0 h9f76cd9_2 conda-forge
glib 2.76.3 ha614eb4_0 conda-forge
glib-tools 2.76.3 ha614eb4_0 conda-forge
gmp 6.2.1 h9f76cd9_0 conda-forge
gnutls 3.7.8 h9f1a10d_0 conda-forge
graphite2 1.3.13 h9f76cd9_1001 conda-forge
gsl 2.7 h6e638da_0 conda-forge
gst-plugins-base 1.22.3 h27255cc_1 conda-forge
gstreamer 1.22.3 he42f4ea_1 conda-forge
harfbuzz 7.3.0 h46e5fef_0 conda-forge
hdf4 4.2.15 h8111dcc_6 conda-forge
hdf5 1.12.2 mpi_mpich_h4e1c725_1 conda-forge
hypre 2.25.0 mpi_mpich_h060cf3c_0 conda-forge
icu 72.1 he12128b_0 conda-forge
idna 3.4 pyhd8ed1ab_0 conda-forge
importlib-metadata 6.6.0 pyha770c72_0 conda-forge
importlib_metadata 6.6.0 hd8ed1ab_0 conda-forge
importlib_resources 5.12.0 pyhd8ed1ab_0 conda-forge
ipykernel 6.23.1 pyh736e0ef_0 conda-forge
ipython 8.14.0 pyhd1c38e8_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 8.0.6 pyhd8ed1ab_0 conda-forge
isl 0.22.1 hc377ac9_3
jedi 0.18.2 pyhd8ed1ab_0 conda-forge
jinja2 3.1.2 pyhd8ed1ab_1 conda-forge
jsoncpp 1.9.5 hc021e02_1 conda-forge
jsonschema 4.17.3 pyhd8ed1ab_0 conda-forge
jupyter 1.0.0 py310hbe9552e_8 conda-forge
jupyter_client 8.2.0 pyhd8ed1ab_0 conda-forge
jupyter_console 6.6.3 pyhd8ed1ab_0 conda-forge
jupyter_core 5.3.0 py310hbe9552e_0 conda-forge
jupyter_events 0.6.3 pyhd8ed1ab_0 conda-forge
jupyter_server 2.6.0 pyhd8ed1ab_0 conda-forge
jupyter_server_terminals 0.4.4 pyhd8ed1ab_1 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 3.0.7 pyhd8ed1ab_1 conda-forge
kiwisolver 1.4.4 py310h2887b22_1 conda-forge
krb5 1.20.1 h69eda48_0 conda-forge
lame 3.100 h1a8c8d9_1003 conda-forge
lcms2 2.15 hd835a16_1 conda-forge
ld64_osx-arm64 609 h7167370_13 conda-forge
lerc 4.0.0 h9a09cb3_0 conda-forge
libadios2 2.8.3 mpi_mpich_h4f585cb_5 conda-forge
libaec 1.0.6 hb7217d7_1 conda-forge
libass 0.17.1 h4da34ad_0 conda-forge
libblas 3.9.0 17_osxarm64_openblas conda-forge
libbrotlicommon 1.0.9 h1a8c8d9_8 conda-forge
libbrotlidec 1.0.9 h1a8c8d9_8 conda-forge
libbrotlienc 1.0.9 h1a8c8d9_8 conda-forge
libcblas 3.9.0 17_osxarm64_openblas conda-forge
libclang 14.0.6 default_h1b80db6_1
libclang-cpp14 14.0.6 default_h1b80db6_1
libclang13 14.0.6 default_h24352ff_1
libcurl 8.1.2 h912dcd9_0 conda-forge
libcxx 16.0.5 h4653b0c_0 conda-forge
libdeflate 1.18 h1a8c8d9_0 conda-forge
libedit 3.1.20191231 hc8eb9b7_2 conda-forge
libev 4.33 h642e427_1 conda-forge
libexpat 2.5.0 hb7217d7_1 conda-forge
libffi 3.4.2 h3422bc3_5 conda-forge
libgfortran 5.0.0 12_2_0_hd922786_31 conda-forge
libgfortran-devel_osx-arm64 11.3.0 h009349e_28
libgfortran5 12.2.0 h0eea778_31 conda-forge
libglib 2.76.3 h24e9cb9_0 conda-forge
libiconv 1.17 he4db4b2_0 conda-forge
libidn2 2.3.4 h1a8c8d9_0 conda-forge
libjpeg-turbo h1a8c8d9_0 conda-forge
liblapack 3.9.0 17_osxarm64_openblas conda-forge
libllvm14 14.0.6 h7ec7a93_3
libnetcdf 4.9.1 mpi_mpich_h6789d60_2 conda-forge
libnghttp2 1.52.0 hae82a92_0 conda-forge
libogg 1.3.4 h27ca646_1 conda-forge
libopenblas 0.3.23 openmp_hc731615_0 conda-forge
libopus 1.3.1 h27ca646_1 conda-forge
libpng 1.6.39 h76d750c_0 conda-forge
libpq 15.3 h7126958_1 conda-forge
libsodium 1.0.18 h27ca646_1 conda-forge
libsqlite 3.42.0 hb31c410_0 conda-forge
libssh2 1.11.0 h7a5bd25_0 conda-forge
libtasn1 4.19.0 h1a8c8d9_0 conda-forge
libtheora 1.1.1 h3422bc3_1005 conda-forge
libtiff 4.5.0 h4f7d55c_6 conda-forge
libunistring 0.9.10 h3422bc3_0 conda-forge
libvorbis 1.3.7 h9f76cd9_0 conda-forge
libvpx 1.13.0 h7ea286d_0 conda-forge
libwebp-base 1.3.0 h1a8c8d9_0 conda-forge
libxcb 1.15 hf346824_0 conda-forge
libxml2 2.10.4 h2aff0a6_0 conda-forge
libzip 1.9.2 h76ab92c_1 conda-forge
libzlib 1.2.13 h53f4e23_5 conda-forge
llvm-openmp 16.0.5 h1c12783_0 conda-forge
llvm-tools 14.0.6 hfd8c8a6_3
loguru 0.7.0 py310hbe9552e_0 conda-forge
lz4-c 1.9.4 hb7217d7_0 conda-forge
make 4.3 he57ea6c_1 conda-forge
markupsafe 2.1.3 py310h2aa6e3c_0 conda-forge
matplotlib-base 3.7.1 py310h78c5c2f_0 conda-forge
matplotlib-inline 0.1.6 pyhd8ed1ab_0 conda-forge
metis 5.1.0 h9f76cd9_1006 conda-forge
mistune 2.0.5 pyhd8ed1ab_0 conda-forge
mpc 1.3.1 h91ba8db_0 conda-forge
mpfr 4.2.0 he09a6ba_0 conda-forge
mpi 1.0 mpich conda-forge
mpi4py 3.1.4 py310hb6d4c64_0 conda-forge
mpich 4.0.3 hd4b5bf3_100 conda-forge
mpmath 1.3.0 pypi_0 pypi
multidict 6.0.4 py310h8e9501a_0 conda-forge
mumps-include 5.2.1 hce30654_11 conda-forge
mumps-mpi 5.2.1 hfd295ca_11 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
mysql-common 8.0.32 h7b5afe1_2 conda-forge
mysql-libs 8.0.32 hb292caa_2 conda-forge
nbclassic 1.0.0 pyhb4ecaf3_1 conda-forge
nbclient 0.8.0 pyhd8ed1ab_0 conda-forge
nbconvert 7.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-core 7.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 7.5.0 pyhd8ed1ab_0 conda-forge
nbformat 5.9.0 pyhd8ed1ab_0 conda-forge
ncurses 6.4 h7ea286d_0 conda-forge
nest-asyncio 1.5.6 pyhd8ed1ab_0 conda-forge
nettle 3.8.1 h63371fa_1 conda-forge
nlohmann_json 3.11.2 h2e04ded_0 conda-forge
notebook 6.5.4 pyha770c72_0 conda-forge
notebook-shim 0.2.3 pyhd8ed1ab_0 conda-forge
nspr 4.35 hb7217d7_0 conda-forge
nss 3.89 h789eff7_0 conda-forge
numpy 1.24.3 py310haa1e00c_0 conda-forge
openh264 2.3.1 hb7217d7_2 conda-forge
openjpeg 2.5.0 hbc2ba62_2 conda-forge
openssl 3.1.1 h53f4e23_1 conda-forge
overrides 7.3.1 pyhd8ed1ab_0 conda-forge
p11-kit 0.24.1 h29577a5_0 conda-forge
packaging 23.1 pyhd8ed1ab_0 conda-forge
pandoc 3.1.3 hce30654_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
pango 1.50.14 h9f7e0c6_1 conda-forge
parmetis 4.0.3 hefa2a9d_1005 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pcre2 10.40 hb34f9b4_0 conda-forge
petsc 3.17.4 real_hce0f69b_101 conda-forge
petsc4py 3.17.4 real_hd154c65_101 conda-forge
pexpect 4.8.0 pyh1a96a4e_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 9.5.0 py310h60ecbdf_1 conda-forge
pip 23.1.2 pyhd8ed1ab_0 conda-forge
pixman 0.40.0 h27ca646_0 conda-forge
pkgutil-resolve-name 1.3.10 pyhd8ed1ab_0 conda-forge
platformdirs 3.5.3 pyhd8ed1ab_0 conda-forge
pooch 1.7.0 pyha770c72_3 conda-forge
proj 9.1.1 h13f728c_2 conda-forge
prometheus_client 0.17.0 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.38 pyha770c72_0 conda-forge
prompt_toolkit 3.0.38 hd8ed1ab_0 conda-forge
psutil 5.9.5 py310h8e9501a_0 conda-forge
pthread-stubs 0.4 h27ca646_1001 conda-forge
ptscotch 6.0.9 hd02db47_2 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pugixml 1.11.4 h13dd4ca_1 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pygments 2.15.1 pyhd8ed1ab_0 conda-forge
pyobjc-core 9.2 py310hd07e440_0 conda-forge
pyobjc-framework-cocoa 9.2 py310hd07e440_0 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyrsistent 0.19.3 py310h8e9501a_0 conda-forge
pysocks 1.7.1 pyha2e5f31_6 conda-forge
python 3.10.11 h3ba56d0_0_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.17.1 pyhd8ed1ab_0 conda-forge
python-json-logger 2.0.7 pyhd8ed1ab_0 conda-forge
python_abi 3.10 3_cp310 conda-forge
pyvista 0.39.1 pyhd8ed1ab_0 conda-forge
pyyaml 6.0 py310h8e9501a_5 conda-forge
pyzmq 25.1.0 py310h30b7201_0 conda-forge
qt-main 5.15.8 h8c42f20_10 conda-forge
r-base 4.2.3 h0794cc7_2 conda-forge
r-crayon 1.5.2 r42hc72bb7e_2 conda-forge
r-diffobj 0.3.5 r42h5d63f41_1 conda-forge
readline 8.2 h92ec313_1 conda-forge
requests 2.31.0 pyhd8ed1ab_0 conda-forge
rfc3339-validator 0.1.4 pyhd8ed1ab_0 conda-forge
rfc3986-validator 0.1.1 pyh9f0ad1d_0 conda-forge
scalapack 2.2.0 hb170938_1 conda-forge
scooby 0.7.2 pyhd8ed1ab_0 conda-forge
scotch 6.0.9 h7537618_2 conda-forge
send2trash 1.8.2 pyhd1c38e8_0 conda-forge
setuptools 67.7.2 pyhd8ed1ab_0 conda-forge
sigtool 0.1.3 h44b9a77_0 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
slepc 3.17.2 real_h5400d42_100 conda-forge
slepc4py 3.17.2 real_h01a885d_101 conda-forge
snappy 1.1.10 h17c5cce_0 conda-forge
sniffio 1.3.0 pyhd8ed1ab_0 conda-forge
soupsieve 2.3.2.post1 pyhd8ed1ab_0 conda-forge
sqlite 3.42.0 h203b68d_0 conda-forge
stack_data 0.6.2 pyhd8ed1ab_0 conda-forge
suitesparse 5.10.1 h7cd81ec_1 conda-forge
superlu 5.2.2 hc615359_0 conda-forge
superlu_dist 7.2.0 h7df07b8_0 conda-forge
svt-av1 1.4.1 h7ea286d_0 conda-forge
sympy 1.12 pypi_0 pypi
tapi 1100.0.11 he4954df_0 conda-forge
tbb 2021.9.0 hffc8910_0 conda-forge
tbb-devel 2021.9.0 h4f9cb39_0 conda-forge
terminado 0.17.1 pyhd1c38e8_0 conda-forge
tinycss2 1.2.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 he1e0b03_0 conda-forge
tktable 2.10 h4161312_3 conda-forge
tornado 6.3.2 py310h2aa6e3c_0 conda-forge
traitlets 5.9.0 pyhd8ed1ab_0 conda-forge
typing-extensions 4.6.3 hd8ed1ab_0 conda-forge
typing_extensions 4.6.3 pyha770c72_0 conda-forge
typing_utils 0.1.0 pyhd8ed1ab_0 conda-forge
tzdata 2023c h71feb2d_0 conda-forge
unicodedata2 15.0.0 py310h8e9501a_0 conda-forge
urllib3 2.0.3 pyhd8ed1ab_0 conda-forge
utfcpp 3.2.3 hce30654_0 conda-forge
vtk 9.2.6 qt_py310h417d410_201 conda-forge
wcwidth 0.2.6 pyhd8ed1ab_0 conda-forge
webencodings 0.5.1 py_1 conda-forge
websocket-client 1.5.3 pyhd8ed1ab_0 conda-forge
wheel 0.40.0 pyhd8ed1ab_0 conda-forge
widgetsnbextension 4.0.7 pyhd8ed1ab_0 conda-forge
wslink 1.11.0 pyhd8ed1ab_0 conda-forge
x264 1!164.3095 h57fd34a_2 conda-forge
x265 3.5 hbc6ce65_3 conda-forge
xorg-libxau 1.0.11 hb547adb_0 conda-forge
xorg-libxdmcp 1.1.3 h27ca646_0 conda-forge
xz 5.2.6 h57fd34a_0 conda-forge
yaml 0.2.5 h3422bc3_2 conda-forge
yarl 1.9.2 py310h2aa6e3c_0 conda-forge
zeromq 4.3.4 hbdafb3b_1 conda-forge
zfp 0.5.5 hcfdfaf5_8 conda-forge
zipp 3.15.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.13 h53f4e23_5 conda-forge
zstd 1.5.2 hf913c23_6 conda-forge

Here you have a mixture of legacy FEniCS and FEniCSx.
This is not a good idea to mix in the same environment.

To be able to further help you, please do the following:

  1. State what software you would like to install (dolfin or dolfinx)
  2. List the commands you used to create your Vonda environment. Encapsulate that code with 3x`
  3. List any error messages received when trying to import the package through:
    A) a python script
    B) a notrbook