installing lefse on Mac M1 laptop

Hi,
Nobody understands how desperately I wanted to get LefSe installed on my MAC M1 laptop, following this instruction:

All my efforts and time went down in flames! :joy:I am posting this just to ask if this instruction works for Mac M1 computers. I appreciate if @sbslee or anyone else with expertise could help!

Here is my background - I am trying to install Lefse on Mac M1. I installed miniforge3 and the python included is v3.10.14. I brew installed pyenv and installed multiple python versions (2.7.15, 3.8.19, 3.12.0) through pyenv, and set the python version to 2.7.15 by

pyenv global 2.7.15

and checked if the switching worked with

which python (or python --version)

and confirmed python was switched to 2.7.15.

then, I ran the code as follows as suggested in the instruction

$ conda create -n lefse -c conda-forge python=2.7.15
$ conda activate lefse
$ conda install -c bioconda -c conda-forge lefse

and got the following output:

Channels:

  • bioconda
  • conda-forge
    Platform: osx-arm64
    Collecting package metadata (repodata.json): done
    Solving environment: failed

LibMambaUnsatisfiableError: Encountered problems while solving:

  • nothing provides icu 58.* needed by lefse-1.0.8.post1-py27_2

Could not solve for environment specs
The following packages are incompatible
└─ lefse is not installable because there are no viable options
├─ lefse 1.0.8.post1 would require
│ └─ icu 58.* , which does not exist (perhaps a missing channel);
└─ lefse [1.1.1|1.1.2] would require
└─ r-coin, which does not exist (perhaps a missing channel).

This is only one of the so many different error I got from trying the three lines of code. It seems each time I got a different error.

Can anyone advise? Thank you very much!

Arlandan

Hi @arlandan,

I don't have an M1 mac to test this out on, but my initial suggestion would be to create a new conda environment that just installs lefse (instead of installing python first and then installing lefse into that env after the fact). I took a look at the dependencies for the newest version of lefse and it just shows a minimum version for python of 2.7 or greater - so using a very specific version of 2.7 might be the problem here. I'd try the following (making sure to remove the existing lefse conda env if you haven't already):

conda create -n lefse -c bioconda -c conda-forge lefse

Hopefully this gets you a successful install! Cheers :lizard:

Hi @lizgehret,
Thank you for the reply. I removed the exising lefse conda env and ran the code you gave, and got the following output:

Channels:

  • bioconda
  • conda-forge
    Platform: osx-arm64
    Collecting package metadata (repodata.json): done
    Solving environment: failed

LibMambaUnsatisfiableError: Encountered problems while solving:

  • nothing provides icu 58.* needed by lefse-1.0.8.post1-py27_2

Could not solve for environment specs
The following packages are incompatible
└─ lefse is not installable because there are no viable options
├─ lefse 1.0.8.post1 would require
│ └─ icu 58.* , which does not exist (perhaps a missing channel);
└─ lefse [1.1.1|1.1.2] would require
└─ r-coin, which does not exist (perhaps a missing channel).

To clarify, lefse was actually installed in a new conda environment and only lefse was installed in that env. while I installed different version of python, these versions did not seem to be working at all. The v3.10.14 that came with miniforge3 always seemed to be the default version on my mac. So I usually do not have problem with creating new enviroment (named lefse) and activating the env, it was just the thrid line of code that never went through.

thanks!

Hi @arlandan,

Hmm, sorry that didn't work! I tested this on my end and was able to get a solved environment, but I'm using an intel Mac. Here are a couple of other recommendations that might work (these are typical steps that I'll take when I'm trying to sort out environment conflicts):

  • Try creating a new environment just using bioconda as the channel spec (i.e. only include -c bioconda instead of -c bioconda -c conda-forge)
  • Try using the classic solver (vs. libmamba) for this environment creation (you'll need to include the --solver classic param in your command)

If these things don't work, you may want to try installing lefse via Docker. I took a look at the README on lefse's Github page, and here's how you'd install via Docker.

Hope this helps! Cheers :lizard:

Hi @lizgehret ,
Sorry for the delay~ Thank you for the solutions!
I tried the "-c bioconda" one and did not work unfortiunately. To get this work, I guess I need to have a miniconda or anaconda. The only installer I have is miniforge3, where I can create new environment.

I tried the second solution - I was able to install Docker, then I followed their instruction and got stuck at the first step :joy:

I give up...dont want to waste my time...

Thanks all for you help!