[Legacy FEniCS 2019.1.0] PackagesNotFoundError: mshr

Hello, I recently upgraded my MacBook from M2 to M4, and I am trying to get my usual legacy fenics setup via conda. For osx-arm64, I typically use the following commands to install:

conda create --override-channels -c conda-forge/osx-64 -c conda-forge/noarch -n fenicsproject fenics mshr

However, now it keeps saying mshr is not found. I have tried many conda channels and still the same situation. I understand that mshr is no longer maintained, but I thought it should still be available on conda-forge (conda: mshr) ?

Alternatively, I tried downloading the .conda file directly from osx-64/mshr-2019.1.0-py39h1d3f879_10.conda and use conda install. However, after the installation is done, importing mshr in a python script under the environment it was installed in was still not found.

Any ideas on how to fix this issue?
Many thanks!

Edit:
here is the output from conda search mshr

Loading channels: done
No match found for: mshr. Search: *mshr*

PackagesNotFoundError: The following packages are not available from current channels:

  - mshr

Current channels:

  - https://conda.anaconda.org/conda-forge/osx-arm64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/osx-arm64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/osx-arm64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

Edit 2:
by specifying the conda mshr link, conda install https://anaconda.org/conda-forge/mshr/2019.1.0/download/osx-64/mshr-2019.1.0-py39h1d3f879_10.conda

This is the installation log:

Downloading and Extracting Packages:
                                                                                       

## Package Plan ##

  environment location: /opt/anaconda3/envs/fenicsproject

  added / updated specs:
    - conda-forge/mshr/2019.1.0/download/osx-64::mshr==2019.1.0=py39h1d3f879_10


The following NEW packages will be INSTALLED:

  mshr               conda-forge/mshr/2019.1.0/download/osx-64::mshr-2019.1.0-py39h1d3f879_10 



Downloading and Extracting Packages:

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

However, same issue of no module mshr:

Traceback (most recent call last):
  File "XXXXXXXXXXXX.py", line 2, in <module>
    import mshr
ModuleNotFoundError: No module named 'mshr'

I’m not sure why, but the above command placing the platform subdir in the channel doesn’t seem to override the platform in conda, though it does seem to still work with mamba. But this version is perhaps more precisely correct to use the --platform argument, and works with both:

mamba create -c conda-forge --platform osx-64 -n fenicsproject fenics mshr
# or
conda create -c conda-forge --platform osx-64 -n fenicsproject fenics mshr

As for the import error, I’m not sure, but could it be that it doesn’t match the Python version of the env? Installing a .conda package directly skips all validity checks of whether it’s compatible with the env it’s being installed into. As always, including the output of conda env export helps when diagnosing conda env issues.

The above created the env for me on an osx-arm64 machine:

conda env export
name: fenicsproject
channels:
  - conda-forge
dependencies:
  - bzip2=1.0.8=hfdf4475_7
  - c-ares=1.34.5=hf13058a_0
  - ca-certificates=2025.4.26=hbd8a1cb_0
  - cctools_osx-64=1010.6=heaa7f0c_1
  - clang=16.0.6=default_h420b035_14
  - clang-16=16.0.6=default_he1224e2_14
  - clang_impl_osx-64=16.0.6=h8787910_19
  - clang_osx-64=16.0.6=hb91bd55_19
  - clangxx=16.0.6=default_h2725d3a_14
  - clangxx_impl_osx-64=16.0.6=h6d92fbe_19
  - clangxx_osx-64=16.0.6=hb91bd55_19
  - compiler-rt=16.0.6=ha38d28d_2
  - compiler-rt_osx-64=16.0.6=ha38d28d_2
  - cpython=3.10.18=py310hd8ed1ab_0
  - eigen=3.4.0=h1c7c39f_0
  - fenics=2019.1.0=h5b579e5_49
  - fenics-dijitso=2019.1.0=pyhd8ed1ab_39
  - fenics-dolfin=2019.1.0=py310hbe6d0bd_49
  - fenics-ffc=2019.1.0=pyhd8ed1ab_40
  - fenics-fiat=2019.1.0=pyhd8ed1ab_40
  - fenics-libdolfin=2019.1.0=h7e12865_49
  - fenics-ufl=2019.1.0=py310h2ec42d9_38
  - fftw=3.3.10=mpi_mpich_h1893886_10
  - gmp=6.3.0=hf036a51_2
  - gmpy2=2.2.1=py310he278d95_0
  - hdf5=1.14.3=mpi_mpich_h116ac41_9
  - hypre=2.31.0=mpi_mpich_h356c364_1
  - icu=75.1=h120a0e1_0
  - krb5=1.21.3=h37d8d59_0
  - ld64_osx-64=951.9=h3516399_1
  - libaec=1.1.3=h73e2aa4_0
  - libblas=3.9.0=31_h7f60823_openblas
  - libboost=1.84.0=hf0da243_7
  - libboost-headers=1.88.0=h694c41f_0
  - libcblas=3.9.0=31_hff6cab4_openblas
  - libclang-cpp16=16.0.6=default_he1224e2_14
  - libcurl=8.14.1=h5dec5d8_0
  - libcxx=20.1.6=hf95d169_0
  - libcxx-devel=16.0.6=h8f8a49f_2
  - libedit=3.1.20250104=pl5321ha958ccf_0
  - libev=4.33=h10d778d_2
  - libexpat=2.7.0=h240833e_0
  - libfabric=2.1.0=h694c41f_1
  - libfabric1=2.1.0=h6e16a3a_1
  - libffi=3.4.6=h281671d_1
  - libgfortran=14.2.0=hef36b68_105
  - libgfortran5=14.2.0=h58528f3_105
  - libhwloc=2.11.2=default_h4cdd727_1001
  - libiconv=1.18=h4b5e92a_1
  - liblapack=3.9.0=31_h236ab99_openblas
  - libllvm16=16.0.6=hbedff68_3
  - liblzma=5.8.1=hd471939_2
  - liblzma-devel=5.8.1=hd471939_2
  - libnghttp2=1.64.0=hc7306c3_0
  - libopenblas=0.3.29=openmp_hbf64a52_0
  - libptscotch=7.0.4=h6939ab0_5
  - libscotch=7.0.4=hfcec5db_5
  - libsqlite=3.50.1=hdb6dae5_0
  - libssh2=1.11.1=hed3591d_0
  - libxml2=2.13.8=h93c44a6_0
  - libzlib=1.3.1=hd23fc13_2
  - llvm-openmp=20.1.6=ha54dae1_0
  - llvm-tools=16.0.6=hbedff68_3
  - metis=5.1.0=h3023b02_1007
  - mpc=1.3.1=h9d8efa1_1
  - mpfr=4.2.1=haed47dc_3
  - mpi=1.0.1=mpich
  - mpi4py=4.0.3=py310h09a579b_101
  - mpich=4.3.0=h86c0334_100
  - mpmath=1.3.0=pyhd8ed1ab_1
  - mshr=2019.1.0=py310hefccdc5_10
  - mumps-include=5.7.3=h694c41f_4
  - mumps-mpi=5.7.3=h0669c1d_4
  - ncurses=6.5=h0622a9a_3
  - numpy=1.26.4=py310h4bfa8fc_0
  - openssl=3.5.0=hc426f3f_1
  - parmetis=4.0.3=hc9a99f5_1007
  - petsc=3.21.5=real_h6bbe012_101
  - petsc4py=3.21.5=py310hc45d6ca_1
  - pip=25.1.1=pyh8b19718_0
  - pkg-config=0.29.2=hf7e621a_1009
  - pkgconfig=1.5.5=pyhd8ed1ab_5
  - pybind11=2.13.4=py310h5334dd0_0
  - pybind11-global=2.13.4=py310h5334dd0_0
  - python=3.10.18=h93e8a92_0_cpython
  - python_abi=3.10=7_cp310
  - readline=8.2=h7cca4af_2
  - scalapack=2.2.0=h8151de6_4
  - setuptools=80.9.0=pyhff2d567_0
  - sigtool=0.1.3=h88f4db0_0
  - six=1.17.0=pyhd8ed1ab_0
  - slepc=3.21.2=real_h278fd84_300
  - slepc4py=3.21.2=py310hd19d021_0
  - suitesparse=7.8.2=ha93ada7_0
  - superlu=7.0.0=h9cb3e3b_1
  - superlu_dist=9.0.0=ha4643b9_1
  - sympy=1.14.0=pyh2585a3b_105
  - tapi=1300.6.5=h390ca13_0
  - tbb=2022.1.0=h479f576_0
  - tk=8.6.13=hf689a15_2
  - tzdata=2025b=h78e105d_0
  - wheel=0.45.1=pyhd8ed1ab_1
  - xz=5.8.1=h357f2ed_2
  - xz-gpl-tools=5.8.1=h357f2ed_2
  - xz-tools=5.8.1=hd471939_2
  - yaml=0.2.5=h0d85af4_2
  - zlib=1.3.1=hd23fc13_2
  - zstd=1.5.7=h8210216_2

prefix: "~/conda/envs/fenicsproject"
1 Like