Closed code-whale closed 2 years ago
Hi @code-whale, that looks like a problem with h5py
and conda
(there is an open issue in conda-forge/h5py-feedstock#103).
I could think of two different possible workarounds:
h5py
in the version that you have in your working environment (conda list
shows all installed packages)h5py
via pip
in your current environment. Apparently the PyPI version cannot have this problem.@marijanbeg Can you reproduce this?
Hi @lang-m ,Thank you for your reply. I'll try to solve this problem again. Here's what I've tried: A Install pip install h5py in the ubermag2 environment according to your instructions, as shown below:
(ubermag2) whalez@MacBook-Pro envs % pip install h5py
Requirement already satisfied: h5py in ./ubermag2/lib/python3.8/site-packages (3.2.1)
Requirement already satisfied: numpy>=1.16.0 in ./ubermag2/lib/python3.8/site-packages (from h5py) (1.22.3)
I installed ubermag in Windows11 and did not show any problems I performed a conda update on all packages in the original ubermag environment - all showed no problems and the upgrade was successful. Ubermag is now version 0.62.1. I modified the conda source priority and replaced it all with conda-forge. The installation test is being carried out to detect if the problem occurs with the Conda source priority or Mac OS.
It is quite possible that the current problem only affects Mac.
My pip
suggestion was missing a flag to force re-installation (pip install h5py --force-reinstall
). Otherwise, it is not actually doing anything. Problem: I am not sure if this will also re-install numpy
and then break at a different point.
@lang-m , I seem to find the problem. As you said, the problem appears on h5py. Some of my conda sources are not conda-forge, but mirrored (in order to improve the download speed), so I installed the h5py version is 3.2.1, while the h5py version of ubermag in conda-forge is 3.6, so there is a mismatch.
I chose the following two methods:
In the case of a non-conda-forge source installation, using pip install-upgrade h5py
in the new environment after installation can solve the problem after testing.
The other is to modify the source (which will affect the download speed in some areas): conda config--add channels conda-forge
and then conda config --set channel_priority strict
.This method comes from the suggestion of @ZhiyuZhang001.
Both of the above methods have successfully solved the problem, and you can turn it off at any time. Thank you again for your help!
TLDR for people coming here in the future: h5py
via conda
does not strictly enforce a compatible hdf5
library during installation. To avoid problems make sure that h5py
and hdf5
are installed from the same channel and compatible (or use pip
for installing h5py
as it brings a compatible hdf5
library).
Dear Ubermag Team, I'm trying to build a new conda environment to use the latest version of ubermag, but the test failed after installation. Do you know why? I use the Mac OS 12 system, and the installation code is:
Errors will be reported when running tests
conda install --channel conda-forge ubermag
and typing something likeimport oommfc as oc
in jupyter. The test return error is as follows:Can you tell me how to solve it? Is there something wrong with the code I built? Looking forward to your reply! Best regards code-whale