Error when installing on Windows: "No module named '_kernel'"

Dear all,

I have encountered a hard-to-reproduce error when installing Mantid 6.11 into a mamba environment on some Windows machines using the recommended steps. The final error message is

ImportError: First import of “._kernel” failed with “DLL load failed while importing _kernel: The specified module could not be found.”. Second import of “_kernel” failed with “No module named ‘_kernel’”

The full error message is the following:
mantid-error.txt (3.1 KB)

This problem appears to be similar to that discussed in an earlier topic, although the basic steps suggested to fix it (i.e. following the recommended installation steps) were followed in this case. The used miniforge version is 24.11.3-0 (this installer) with Python 3.12.8.

Curiously, this error only occurs on some of the machines that Mantid was installed on in this way. For instance, the default steps have worked on a fresh Windows 11 install but not on some older installs. These typically already had Conda installed, making me wonder whether existing Conda installs and factors like that could play a role. I am trying hard to make sense of the problem and recognize a pattern so this could be irrelevant.

For context, at the Reactor Institute in Delft, we are currently rolling out a prototype of a Mantid-based SANS reduction package tailored to our new SANS instrument. This currently takes the form of a separate Python package that is installed into the environment.

Thank you for your time

Hi,

Can I check - are you dowloading Python into your environment before loading Mantid?

Thanks

Sarah

Thank you for responding so quickly. I’m not downloading it before that, at least not explicitly. Running the command mamba create -n mantid_env -c mantid mantid implicitly seems to download and pin Python version 3.10.16, which shows up when running mamba list after activating the created environment. python --version also gives this version. Note that this is on my local install where everything works, but I assume this is the same on the other machines where problems occurred.

Hi,

It might help to remove unused packages and caches from machines with pre-existing Mantid conda environments before installing Mantid again. Just run conda clean -a -y after removing an old Mantid conda environment. Removing an old environment does not clean the caches automatically, so it is possible that there are old packages that interfere with the new installation.

Silke