ubermag / help

Repository for raising issues and requesting help on Ubermag
BSD 2-Clause "Simplified" License
11 stars 3 forks source link

October update #262

Closed SeregaKR closed 1 year ago

SeregaKR commented 1 year ago

Good afternoon. I'm trying to update ubermag to the last update. Can you please clarify the system requirements?

It seems that there were some changes. After the initial update to the October version, I received the package version conflict errors. So, I decided to do a clean reinstall of Anaconda and ubermag. But now I'm stuck - "Solving environment" simply is not working. It collects repodata.json. I have Ubuntu 20.04 LTS, Anaconda 2023.09. Any ideas? Most of the Google suggestions are about using mamba.

I'll try playing with Anaconda versions - probably it will help

marijanbeg commented 1 year ago

Hi @SeregaKR, thank you for raising this issue. We are aware of this problem, but, unfortunately, we currently do not know the solution except switching to mamba. We had a similar issue with previous versions, and what helped was to specify the version of Ubermag when running conda install --channel conda-forge ubermag==xxx because it was not always finding the newest one on some operating systems. Unfortunately, we still have not found what package (Ubermag dependency) is causing issues while solving the environment.

We would be grateful if you could let us know the working solution using conda if you find one.

lang-m commented 1 year ago

Some additional remarks: the system requirements have not changed with the latest update.

The steps to use mamba would be:

SeregaKR commented 1 year ago

After some time (and trying to update conda) I started getting an error about conda-libmamba-solver. This discussion seems relevant https://github.com/ContinuumIO/anaconda-issues/issues/13123

I'll try the solution you offered and report back

lang-m commented 1 year ago

@marijanbeg I tried the conda installation. For me

conda create -n ubermag2023.10 -y -c conda-forge python=3.10 ubermag

works and installs the full environment in ~10 minutes.

I used conda 23.9.0.

marijanbeg commented 1 year ago

Does it install the newest Ubermag or pulls an older version?

lang-m commented 1 year ago

The newest version (2023.10)

lang-m commented 1 year ago
❯ python -c "import ubermag; print(ubermag.debug_info())"
Platform: linux
Python: 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:40:32) [GCC 12.3.0]

ubermagutil: 0.63.2
discretisedfield: 0.90.0
ubermagtable: 0.61.3
micromagneticmodel: 0.63.2
micromagneticdata: 0.65.1
micromagnetictests: 0.63.1
mumax3c: 0.2.0
oommfc: 0.64.1
mag2exp: 0.62.2
ubermag: 2023.10

OOMMF: ExeOOMMFRunner(/home/mlang/miniconda3/envs/ubermag2023.10/bin/oommf), 2.0b0
Mumax3: Mumax3 cannot be found. Mumax3 does not come automatically with Ubermag. Make sure it is properly installed and can be found on the command line.
SeregaKR commented 1 year ago

I installed miniforge from here: https://github.com/conda-forge/miniforge and did the same as written before in the installation guide.

mamba create -n ubermag_env python=3.10
mamba activate ubermag_env
mamba install --channel conda-forge ubermag
mamba install notebook

Now everything looks fine. The new version 2023.10 is installed

lang-m commented 1 year ago

@SeregaKR The last step, mamba install notebook, should not be necessary as this should automatically be installed as a dependency.

SeregaKR commented 1 year ago

In my case, there was an error when I tried running jupyter-notebook.

Edited. The page seems fine, sorry for misleading

lang-m commented 1 year ago

You are right, jupyter notebook (and lab) are missing. (We have to fix this @samjrholt , @swapneelap )

samjrholt commented 1 year ago

You are right, jupyter notebook (and lab) are missing. (We have to fix this @samjrholt , @swapneelap )

I've just checked and it is in the pyproject.toml but not the conda-forge ubermag-feedstock meta.yml as a dependency.

swapneelap commented 1 year ago

Hmm, I do not think we included jupyterlab in the meta.yml even in the release before. Is this because discretisedfield no longer depends on jupyterlab?

marijanbeg commented 1 year ago

jupyter was in discretisedfield because of the widgets for plotting.

samjrholt commented 1 year ago

This is being fixed in https://github.com/conda-forge/ubermag-feedstock/pull/21

dimap1981 commented 1 year ago

Hi folks, I tried what was suggested above with mamba, but upon running

mamba install --channel conda-forge ubermag

I am getting the following error:

Could not solve for environment specs
The following packages are incompatible
└─ ubermag   is uninstallable because there are no viable options
   ├─ ubermag 0.1 would require
   │  └─ oommfc   but there are no viable options
   │     ├─ oommfc [0.10|0.10.1|...|0.9] would require
   │     │  └─ oommf 2.0a1 , which does not exist (perhaps a missing channel);
   │     ├─ oommfc 0.60.0 would require
   │     │  └─ oommf 2.0a2 , which does not exist (perhaps a missing channel);
   │     ├─ oommfc [0.61.0|0.61.1|0.62.0|0.63.0] would require
   │     │  └─ oommf 2.0a3 , which does not exist (perhaps a missing channel);
   │     ├─ oommfc [0.64.0|0.64.1] would require
   │     │  └─ oommf 2.0b0 , which does not exist (perhaps a missing channel);
   │     └─ oommfc [0.8.10|0.8.11|...|0.8.9] would require
   │        └─ oommf  , which does not exist (perhaps a missing channel);
   ├─ ubermag [0.1.1|0.21|...|0.51] would require
   │  └─ oommfc [0.10 |0.10.1 |...|0.8.25 ], which cannot be installed (as previously explained);
   ├─ ubermag 0.60.0 would require
   │  └─ oommfc 0.60.0 , which cannot be installed (as previously explained);
   ├─ ubermag [0.61.0|0.61.2|...|0.65.0] would require
   │  └─ oommfc [0.61.0 |0.61.1 |0.62.0 |0.63.0 ], which cannot be installed (as previously explained);
   └─ ubermag [0.66.0|0.66.1|2023.10] would require
      └─ oommfc [0.64.0 |0.64.1 ], which cannot be installed (as previously explained).

Please, advise.

lang-m commented 1 year ago

@dimap1981 What hardware are you on? Maybe Apple with an ARM processor?

dimap1981 commented 1 year ago

@dimap1981 What hardware are you on? Maybe Apple with an ARM processor?

@lang-m yes I am! Apologies for not providing the relevant info, I am very new to this.

lang-m commented 1 year ago

Thanks for clarifying @dimap1981 . The problem is that we currently do not provide a conda package for OOMMF. Instead you will have to compile OOMMF yourself and can afterwards use it together with Ubermag.

I would recommend that you take OOMMF from github.com/fangohr/oommf and follow the installation in that repository. (This version includes a few additional extensions supported in Ubermag that are currently missing in the official OOMMF distribution.)

Afterwards you can install Ubermag using pip (in which case it comes without OOMMF, installation also documented here https://ubermag.github.io/installation.html#standard-installation-recommended) and combine it with your self-compiled OOMMF. The process is documented here: https://ubermag.github.io/installation.html#advanced-installation.

dimap1981 commented 1 year ago

Thanks very much for the directions, @lang-m . I have been able to install both ubermag and oommf, but they cannot communicate. Details are below, I would appreciate a hint if you have a moment:

I installed oommf, and checked the installation with make test-all from the oommf directory. It worked. I set the environment variable in .bash_profile as described in ubermag instruction. The last line of .bash_profile reads export OOMMFTCL="/Users/#####/oommf/oommf/oommf.tcl" I was also able to install ubermag with pip3 install ubermag the installer ran without problems. Finally, when I run python3 and then import oommfc oommfc.runner.runner.status The output is Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'oommfc' is not defined. Did you mean: 'oommf'?

Can you spot what I did wrong? Thanks!

lang-m commented 1 year ago

That is some problem with the Python package oommfc itself (not yet the communication with OOMMF). My first guess would be that you installed ubermag into a different (virtual) environment than the one you used when trying to use oommfc.

dimap1981 commented 1 year ago

Got it to work, thanks for the help, @lang-m. For those who may struggle with M1 machines later on: I Installed ubermag and oommf into the same virtual environment with pip, and set the OOMMFTLC environment variable in .zshrc rather than .bash_profile, since newer versions of macos use zsh, not bash. After that last step I could run simulations from examples.

samjrholt commented 1 year ago

We have created a new build for conda-forge which includes jupyter lab https://github.com/conda-forge/ubermag-feedstock/pull/21 to address the original issue