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

Installing ASReview backend fails on Apple M1 chip #738

Closed
ottomattas opened this issue Sep 13, 2021 · 6 comments
Closed

Installing ASReview backend fails on Apple M1 chip #738

ottomattas opened this issue Sep 13, 2021 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@ottomattas
Copy link

Describe the bug
Trying to install ASReview in DEVELOPMENT mode fails on an Apple M1 chip. Process takes about 1 hour to complete.

To Reproduce
Steps to reproduce the problem:

  1. Pull the latest code from the repository
  2. Navigate to the repository locally
  3. pip install -e .

Version information

  • OS: macOS Big Sur Version 11.5.2 (20G95)
  • MacBook Pro (13-inch, M1, 2020)

Additional context
Full CLI output attached as a zip container.

@ottomattas ottomattas added the bug Something isn't working label Sep 13, 2021
@ottomattas
Copy link
Author

From the looks of it, there are three packages that need a workaround - h5py, scikit-learn, scipy.

Relevant section from the end of CLI output:

Successfully built gevent greenlet pandas zope.interface
Failed to build h5py scikit-learn scipy
Installing collected packages: scipy, numpy, Jinja2, itsdangerous, click, zope.interface, zope.event, scikit-learn, pytz, python-dateutil, greenlet, flask, et-xmlfile, xlrd, sklearn, rispy, pandas, openpyxl, h5py, gevent, flask-cors, dill, asreview

@ottomattas ottomattas self-assigned this Sep 13, 2021
@ottomattas
Copy link
Author

ottomattas commented Sep 15, 2021

For users

There is a quick workaround, using miniforge.

# Install miniforge
% brew install miniforge

# Create environment
% conda create --name asreview_m1

# Initialise (zsh) shell
% conda init zsh

# Source (zsh) shell directly
% . ~/.zshrc

# Activate environment
% conda activate asreview_m1

# Install packages which fail to install via pip
% conda install h5py scipy scikit-learn

# Install asreview
% pip install asreview

# Delete the environment, in case you need to clean up afterwards
% conda deactivate
% conda env remove -n asreview_m1

This workaround was inspired by Hendrik Erz, a researcher and an Open Source contributor. If you want to read up on the method proposed here, you can see his blog post on the issue.

For developers

There is a quick workaround, using miniforge.

# Install miniforge
% brew install miniforge

# Create environment
% conda create --name asreview_m1

# Initialise (zsh) shell
% conda init zsh

# Source (zsh) shell directly
% . ~/.zshrc

# Activate environment
% conda activate asreview_m1

# Install packages which fail to install via pip
% conda install h5py scipy scikit-learn

# Install asreview
% pip install -e .

# Delete the environment, in case you need to clean up afterwards
% conda deactivate
% conda env remove -n asreview_m1

This workaround was inspired by Hendrik Erz, a researcher and an Open Source contributor. If you want to read up on the method proposed here, you can see his blog post on the issue.

@J535D165 J535D165 pinned this issue Sep 15, 2021
@MarielleZZ
Copy link

MarielleZZ commented Feb 12, 2022

Starting with a git clone + cd on asreview and proceeding with the workaround above was successful for me:

git clone https://github.com/asreview/asreview.git
cd asreview

brew install miniforge
conda create --name asreview_m1

conda init zsh
. ~/.zshrc
conda activate asreview_m1
conda install h5py scipy scikit-learn
pip install -e .
conda deactivate
conda env remove -n asreview_m1

@ottomattas
Copy link
Author

Thanks for reporting back and confirming the proposed solution @MarielleZZ!

@hjiajing
Copy link

hjiajing commented Mar 18, 2022

I didn't address this M1 issue following the above workaround. But I ran pip3 install asreview and it worked fine. Then I ran asreview lab, the asreview ran successfully. 😂

(base) aaronhu@AarondeMacBook-Air ~ % python --version
Python 3.9.7
(base) aaronhu@AarondeMacBook-Air ~ % pip3 --version
pip 21.2.4 from /Users/aaronhu/opt/miniconda3/lib/python3.9/site-packages/pip (python 3.9)

@pietervandekerckhove
Copy link

Thank you @hjiajing , it worked for me as well in this way :)

@PeterLombaers PeterLombaers unpinned this issue Nov 28, 2023
@PeterLombaers PeterLombaers pinned this issue Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants