faircloth-lab / phyluce

software for UCE (and general) phylogenomics
http://phyluce.readthedocs.org/
Other
78 stars 49 forks source link

Phyluce on Apple M-series Processors #281

Closed coliverbrown closed 1 year ago

coliverbrown commented 2 years ago

Hi Brant, I'm installing phyluce onto a Mac but when I'm trying to create the conda environment, it fails. The error message reads "ResolvePackageNotFound:" and then lists what looks like dependences. I'll post it below. The .yml file downloaded just fine and I can open it up and read it. Any help would be appreciated. Thanks!

Here's the code and terminal output:

`--2022-09-23 16:04:56-- https://raw.githubusercontent.com/faircloth-lab/phyluce/v1.7.1/distrib/phyluce-1.7.1-py36-macOS-conda.yml Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 3988 (3.9K) [text/plain] Saving to: 'phyluce-1.7.1-py36-macOS-conda.yml'

phyluce-1.7.1-py36-macOS-conda.yml 100%[===============================================================>] 3.89K --.-KB/s in 0s

2022-09-23 16:04:57 (10.9 MB/s) - 'phyluce-1.7.1-py36-macOS-conda.yml' saved [3988/3988]

(base) fbk-02uq6x9:~ corvus$ conda env create -n phyluce-1.7.1 --file phyluce-1.7.1-py36-macOS-conda.yml Collecting package metadata (repodata.json): done Solving environment: failed

ResolvePackageNotFound:

brantfaircloth commented 2 years ago

Do you happen to be on a M1 or M2 CPU on whatever machine you are using? My experience with this (I have an M1 laptop and a new M1 desktop) is that the underlying packages needed for installation (from bioconda) have not all been ported appropriately to the M1 CPU (so some/many of them do not exist).

This means I will need to create a new configuration file for M-series CPU macs... but I have not had time to do that yet. I'm also not sure that all the bioconda packages needed are available for M1 macs yet - which could also an additional delay.

brantfaircloth commented 2 years ago

One somewhat non-intuitive way to work around the error is to install the intel-64 version of miniconda (versus the m1 version), which should run the required dependencies under emulation...

coliverbrown commented 2 years ago

Hi Brant, Thanks for the update. Yes, I'm using a new M1 desktop so that explains the issue. I'll try that intel-64 version first but I understand that an update might take a bit.

tauanajc commented 1 year ago

Hello there, I am having the same issue trying to install the latest version of phyluce with Anaconda (instead of miniconda) on my institution's cluster. Will try a previous version, but wanted to mention it here in case it adds any information.

jsalt commented 1 year ago

One somewhat non-intuitive way to work around the error is to install the intel-64 version of miniconda (versus the m1 version), which should run the required dependencies under emulation...

Hi Brant! I'm currently helping the PhD student in our lab install phyluce on her M1 chip mac and we ran into this exact issue, but your workaround solved the problem! We re-installed miniconda3 using the x84-64 version and successfully installed phyluce using the conda env create -n phyluce-1.7.1 --file phyluce-1.7.1-py36-macOS-conda.yml command.

Just wanted to share for anyone else having this issue.

brantfaircloth commented 1 year ago

Here’s some more info about setting up conda to allow an x86-64 environment alongside the ARM (m1) native environment.

https://towardsdatascience.com/how-to-manage-conda-environments-on-an-apple-silicon-m1-mac-1e29cb3bad12

brantfaircloth commented 1 year ago

Ok, I've adjusted some things so that I can install an x86 environment on my M1 machine. The procedure is as follows:

  1. Install miniconda for the M-series Apple CPUs
  2. Run the following:
    # the next line must be run at the same time (e.g. do not split it up)
    CONDA_SUBDIR=osx-64 conda create -n phyluce-1.7.1-x86 python=3.6
    conda activate phyluce-1.7.1-x86
    conda config --env --set subdir osx-64
    conda env update --name phyluce-1.7.1-x86 --file phyluce-1.7.1-py36-macOS-conda.yml --prune
  3. You should be good to go

What this does is basically install conda for the M-series CPUs on your machine (so it's "native" by default), but then sets up an x86 environment for phyluce that will run in emulation. ONLY the phyluce-1.7.1-x86 conda environment is set to x86 in this example (although you could adjust for other environments, if needed).

Thanks to Danny Cunningham's post for the pointers.

coliverbrown commented 1 year ago

Thanks all! I've got phyluce working now

henicorhina commented 1 year ago

Hey Brant, This installation worked perfectly for me on an M1 mac, except for one package:

ResolvePackageNotFound:

brantfaircloth commented 1 year ago

Yes, the instructions have you grabbing an older version of the yml file - I need to update them. Try to pull a new one:

wget https://raw.githubusercontent.com/faircloth-lab/phyluce/main/distrib/phyluce-1.7.1-py36-macOS-conda.yml

and you should be good to go.

henicorhina commented 1 year ago

Thanks! That new .yml worked perfectly

brantfaircloth commented 1 year ago

This has now been updated in the 1.7.2 release.