Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot install CRISPResso on Mac Apple M2 chip laptop #287

Closed
tracie-mg opened this issue Feb 16, 2023 · 13 comments
Closed

cannot install CRISPResso on Mac Apple M2 chip laptop #287

tracie-mg opened this issue Feb 16, 2023 · 13 comments

Comments

@tracie-mg
Copy link

tracie-mg commented Feb 16, 2023

Hello,

I've been trying to install CRISPResso2 for the past 2 days and kept running into the same issue. I've installed Rosetta2

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

then

conda config --add subdirs osx-64
conda clean -i (clean the repo index)
conda clean --all (clean all packages)
CONDA_SUBDIR=osx-64 conda create -n crispresso2-env -c bioconda -c conda-forge crispresso2 -python=2.7

then activated and tried running CRISPResso -h

(crispresso2-env) tracieluong@metam-166 ~ % CRISPResso -h
Traceback (most recent call last):
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/bin/CRISPResso", line 11, in <module>
    load_entry_point('CRISPResso2==2.1.3', 'console_scripts', 'CRISPResso')()
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/CRISPResso2/CRISPRessoCORE.py", line 34, in <module>
    from CRISPResso2 import CRISPRessoPlot
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/CRISPResso2/CRISPRessoPlot.py", line 19, in <module>
    import seaborn as sns
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/seaborn/__init__.py", line 6, in <module>
    from .rcmod import *
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/seaborn/rcmod.py", line 8, in <module>
    from . import palettes, _orig_rc_params
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/seaborn/palettes.py", line 12, in <module>
    from .utils import desaturate, set_hls_values, get_color_cycle
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/seaborn/utils.py", line 7, in <module>
    from scipy import stats
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/scipy/stats/__init__.py", line 345, in <module>
    from .stats import *
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/scipy/stats/stats.py", line 169, in <module>
    import scipy.special as special
  File "/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/scipy/special/__init__.py", line 640, in <module>
    from ._ufuncs import *
ImportError: dlopen(/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/scipy/special/_ufuncs.so, 0x0002): Library not loaded: @rpath/libopenblas.dylib
  Referenced from: <78071D2A-5896-3FDE-B3C6-55BA7A71BB22> /Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/scipy/special/_ufuncs.so
  Reason: tried: '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/scipy/special/../../../../libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/scipy/special/../../../../libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/bin/../lib/libopenblas.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS@rpath/libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/scipy/special/../../../../libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/python2.7/site-packages/scipy/special/../../../../libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/tracieluong/miniconda3/envs/crispresso2-env/lib/libopenblas.dylib' (no such file), '/Users/tracieluong/miniconda3/envs/crispresso2-env/bin/../lib/libopenblas.dylib' (no such file), '/usr/local/lib/libopenblas.dylib' (no such file), '/usr/lib/libopenblas.dylib' (no such file, not in dyld cache)

Please let me know if how I can solve this. Thank you!

@Colelyman
Copy link
Contributor

Colelyman commented Feb 16, 2023

Hi @tracie-mg,

Sorry to hear that you are having trouble! I think the issue is that you are installing Python 2 instead of Python 3. Recent versions of CRISPResso2 only works with Python 3. Could you try this command to see if it makes any difference?

CONDA_SUBDIR=osx-64 conda create -n crispresso2-env -c bioconda -c conda-forge crispresso2 python=3.10

Good luck,
Cole

@tracie-mg tracie-mg changed the title cannot install CRISPResso on Mac M1 laptop cannot install CRISPResso on Mac Apple M2 chip laptop Feb 16, 2023
@Colelyman
Copy link
Contributor

If you need to use Python 2 (which means you will use an older version of CRISPResso2 when it was supported) this issue may be helpful. Because the error is that one of the dependencies of CRISPResso2 can't find a library that it needs.

@tracie-mg
Copy link
Author

this issue

Thanks Cole! I tried this and am now getting a new error relating to my osx version:

(base) tracieluong@metam-166 ~ % CONDA_SUBDIR=osx-64 conda create -n crispresso2-env -c bioconda -c conda-forge crispresso2 python=3.10
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: \ 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                            

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package python conflicts for:
python=3.10
crispresso2 -> bowtie2 -> python[version='2.6.*|2.7.*|3.5.*|3.6.*|>=3.5,<3.6.0a0|3.4.*|>=3.11,<3.12.0a0|>=3.7.1,<3.8.0a0|3.10.*|3.9.*|3.8.*|3.7.*']
crispresso2 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.9,<3.10.0a0|>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0']The following specifications were found to be incompatible with your system:

  - feature:/osx-64::__osx==13.0=0
  - crispresso2 -> matplotlib-base -> __osx[version='>=10.11|>=10.12']

Your installed version is: 13.0

@Colelyman
Copy link
Contributor

Strange. Does it work if you only specify ... python=3? Or if you remove python altogether?

@tracie-mg
Copy link
Author

tracie-mg commented Feb 16, 2023

When I remove python altogether, it automatically downloads python=2.7 within the environment, which gave the first error above. When specifying ... python=3, I get an osx version error

(base) tracieluong@metam-166 ~ % CONDA_SUBDIR=osx-64 conda create -n crispresso2_env -c bioconda crispresso2 python=3
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: / 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                                                                  

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package python conflicts for:
crispresso2 -> bowtie2 -> python[version='2.6.*|2.7.*|3.5.*|3.6.*|>=3.5,<3.6.0a0|3.4.*|>=3.11,<3.12.0a0|>=3.7.1,<3.8.0a0|3.10.*|3.9.*|3.8.*|3.7.*']
python=3
crispresso2 -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.9,<3.10.0a0|>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0']The following specifications were found to be incompatible with your system:

  - feature:/osx-64::__osx==13.0=0
  - feature:|@/osx-64::__osx==13.0=0
  - crispresso2 -> matplotlib-base -> __osx[version='>=10.11|>=10.12']

Your installed version is: 13.0

@Colelyman
Copy link
Contributor

Colelyman commented Feb 16, 2023

Interesting, thanks for trying those. I'm honestly not sure what is going on and wish I could be more helpful.

Here are some thoughts I had, not sure if they will be helpful or not:

  • Can you successfully install other packages through conda? Like conda install numpy or conda install -c bioconda bowtie2?
  • Did you install the M1 version of miniconda? Found here. You can additionally check by running conda info and looking at what platform says.

I have a M1 Mac, and the result of conda info looks like this:


     active environment : base
    active env location : /Users/cole/mambaforge
            shell level : 1
       user config file : /Users/cole/.condarc
 populated config files : /Users/cole/mambaforge/.condarc
                          /Users/cole/.condarc
          conda version : 4.14.0
    conda-build version : not installed
         python version : 3.10.6.final.0
       virtual packages : __osx=12.6.3=0
                          __unix=0=0
                          __archspec=1=arm64
       base environment : /Users/cole/mambaforge  (writable)
      conda av data dir : /Users/cole/mambaforge/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/bioconda/osx-64
          package cache : /Users/cole/mambaforge/pkgs
                          /Users/cole/.conda/pkgs
       envs directories : /Users/cole/mambaforge/envs
                          /Users/cole/.conda/envs
               platform : osx-arm64
             user-agent : conda/4.14.0 requests/2.28.1 CPython/3.10.6 Darwin/21.6.0 OSX/12.6.3
                UID:GID : 501:20
             netrc file : None
           offline mode : False

It is interesting if you look under virtual packages it says that __osx=12.6.3=0 and I'm on Mac OS Monterey. Do you happen to be on Mac OS Ventura? Not sure if that has anything to do with it.

If you unfortunately can't get CRISPResso2 to be installed via conda, you could try using Docker. Because you are using Apple Silicon, you will need to add the parameter --platform linux/amd64 to the run and build commands. Here are the steps you would need to take:

  1. Install Docker.
  2. In case you haven't already, clone the repository. git clone https://github.com/pinellolab/CRISPResso2.git
  3. Navigate to the directory. cd CRISPResso2
  4. Build the CRISPResso2 Docker image with cross platform support. docker buildx build --platform linux/amd64 --load -t crispresso2 .
  5. Run the CRISPResso2 Docker container. docker run -v ${PWD}:/DATA -w /DATA --platform linux/amd64 --rm crispresso2 CRISPResso -r1 reads.fastq...

I found this blog post helpful when trying to get Docker working on Apple Silicon.

@tracie-mg
Copy link
Author

Thanks for all the suggestions! I can install numpy and bowtie2 with no issues. My downloaded miniconda3 is the same one you linked (MacOSX-arm64) and my conda info shows:

active environment : base
    active env location : /Users/tracieluong/miniconda3
            shell level : 1
       user config file : /Users/tracieluong/.condarc
 populated config files : /Users/tracieluong/.condarc
          conda version : 23.1.0
    conda-build version : not installed
         python version : 3.10.9.final.0
       virtual packages : __archspec=1=arm64
                          __osx=13.0=0
                          __unix=0=0
       base environment : /Users/tracieluong/miniconda3  (writable)
      conda av data dir : /Users/tracieluong/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-arm64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-arm64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/bioconda/osx-arm64
                          https://conda.anaconda.org/bioconda/noarch
          package cache : /Users/tracieluong/miniconda3/pkgs
                          /Users/tracieluong/.conda/pkgs
       envs directories : /Users/tracieluong/miniconda3/envs
                          /Users/tracieluong/.conda/envs
               platform : osx-arm64
             user-agent : conda/23.1.0 requests/2.28.1 CPython/3.10.9 Darwin/22.1.0 OSX/13.0
                UID:GID : 502:20
             netrc file : None
           offline mode : False

I do have Mac Ventura 13.0 and my conda version is much newer. I wonder if that's the issue.

Anyhow, I can successfully use CRISPResso2 via Docker. Thank you again!

@kclem
Copy link
Member

kclem commented Apr 13, 2023

We're closing this issue because it hasn't been updated recently. If this issue still exists, please reopen this issue and we'll look into it!

@kclem kclem closed this as completed Apr 13, 2023
@Nacho114
Copy link

Hello,

I'm having the exact same issue on an M1 mac (running macOS Ventura 13.0).

In particular I have the following issue that tracie-mg mentioned:

"When I remove python altogether, it automatically downloads python=2.7 within the environment, which gave the first error above. When specifying ... python=3, I get an osx version error"

I did manage to get the docker working, but it is very slow on macOS (at least for me), takes 10min vs 1min on conda. @tracie-mg how has been the run time for you on docker?

What's weird is that I've managed to make Cirspresso2 work on conda not long ago on this same machine. A colleague was having this same issue, so I want to clean install to try and reproduce it on my machine. Sadly after clean installing conda, I now have the issue outlined in this thread.

I've tried everything suggested in this thread (clean installed conda / make sure rosetta is installed / ...)

Any ideas on what to try next?

@Colelyman
Copy link
Contributor

Hi @Nacho114,

Sorry to hear that you are having trouble, these errors are very frustrating (I'm on a M1 mac as well, but haven't upgraded to Ventura 13.0 out of fear for this issue).

One thing to try would be installing CRISPResso from source. You can do that by:

  1. Cloning the repo and navigating to the directory into which it was cloned.
  2. Running pip install . in the directory (note that pip will try and install some dependencies, it can sometimes be easier to install them via conda before installing via pip).

This should be faster than Docker and hopefully won't be susceptible to the OSX version error. Please let me know if this works for you!

Thanks,
Cole

@Nacho114
Copy link

Thanks, did that at the end!
Btw, I needed to manually install Flash / make it and at it to the path. Not sure if was documented or was supposed to be done automatically. Happy to update the docs to add a warning about 13 ventura and how to build / install flash

@Colelyman
Copy link
Contributor

Thanks for your offer @Nacho114, I can update the docs. Were you able to install Flash from conda?

Also, I think I have narrowed down the issue to be with the matplotlib-base package. I have filed an issue on that package conda-forge/matplotlib-feedstock#351, hopefully we can find a fix for this soon!

@Nacho114
Copy link

Thanks!

I built Flash from scratch, did not think installing it via conda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants