Can't install Prodigy - Apple M1

What am I doing wrong?
ERROR: prodigy-1.10.5-cp36.cp37.cp38-cp36m.cp37m.cp38-macosx_10_14_x86_64.whl is not a supported wheel on this platform.

I also tried changing to 11.1_ARM64.whl

I was able to install the file no problem on my intel Mac.

I have the same issue : can't install Prodigy on MacOS Big Sur (11.1) on an ARM Mac M1

I also tried to use Docker instead:

FROM python:3.8
COPY wheels/prodigy-*linux_x86_64.whl /root
RUN pip install /root/prodigy-*linux_x86_64.whl

--> I get the same error message:
ERROR: prodigy-1.10.5-cp36.cp37.cp38-cp36m.cp37m.cp38-linux_x86_64.whl is not a supported wheel on this platform.

1 Like

The *macosx_10_14_x86_64.whl wheels won't run natively on an ARM mac, but you can run OSX x86_64 applications in emulation mode.

One relatively easy option to get python in emulation mode is to run everything in a conda env for OSX x86_64.

  1. Download and install miniconda3: https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.pkg

    (You could also use miniforge or another conda installer. We do have native spacy OSX ARM64 packages on the conda-forge channel, and at some point there will hopefully be native spacy and prodigy wheels, but our build infrastructure doesn't support it yet.)

  2. Restart your terminal so that it updates the path/conda settings.

  3. Create a new conda env with python3.8 and activate it:

    conda create -n prodigy python=3.8
    conda activate prodigy
    
  4. Install prodigy:

    pip install prodigy-1.10.5-cp36.cp37.cp38-cp36m.cp37m.cp38-macosx_10_14_x86_64.whl
    

When you're working in this conda env, it should be just like working on an intel/x86_64 mac.

You can also do something similar by creating/using a terminal app that runs in emulation mode and being careful to install/run everything from this terminal. Here's one tutorial on setting up a Terminal for x86. Then use the system /usr/bin/python3 to create a venv and install prodigy from there. If you accidentally mix up your terminals or venvs I think things may break in unexpected ways, so the conda setup with x86-only python may be easier to manage.

Thank you. I will try it.

Here's a workaround to get Prodigy running on your shiny new device using Docker Preview for Apple M1, and also using miniconda3 to get the Prodigy wheel installed. The conda environment is loaded using the bash run control file such that each time a shell is launched (e.g. docker run ...) the environment will be automatically loaded.

Note that this dockerfile build includes the spacy models and takes a while to download. Comment out the models that you don't use for faster build.

You need to create two files:
environment.yml -- this will be used by conda
dockerfile -- to build a docker image

# The environment.yml file is as follows
name: myenv
channels:
 - conda-forge
 dependencies:
 - python=3.8
 - flask

Here is the dockerfile definition

# Dockerfile for prodigy using conda so you can run on Apple M1.
# Author: Christopher Connolly
# Date: 15 Feb 2021
#
# Instructions:
# Place your linux-wheel (prodigy-1.8.5-cp35.cp36.cp37-cp35m.cp36m.cp37m-linux_x86_64.whl) in same directoty as this dockerfile.
#
# Then run:
# $ docker build . -t prodigy
# $ docker run -it -p 9001:8080 -v "$(pwd):/work" prodigy bash
FROM continuumio/miniconda3
WORKDIR /app

# Create the environment:
COPY environment.yml .
RUN conda env create -f environment.yml

# Make RUN commands use the new environment:
SHELL ["conda", "run", "-n", "myenv", "/bin/bash", "-c"]

# Install Prodigy Application
RUN mkdir /prodigy
WORKDIR /prodigy

COPY ./prodigy-1.10.6-cp36.cp37.cp38-cp36m.cp37m.cp38-linux_x86_64.whl /prodigy
RUN pip install prodigy-1.10.6-cp36.cp37.cp38-cp36m.cp37m.cp38-linux_x86_64.whl

# Make sure the environment is activated:
RUN echo "Make sure spacy is installed:"
RUN python -c "import spacy"

# Expose services
EXPOSE 8080
RUN mkdir /work
ENV PRODIGY_HOME /work
WORKDIR /work

# Use bash as the shell and activate the environment on load
SHELL ["/bin/bash", "-c"]
RUN echo "source activate myenv" > ~/.bashrc
ENV PATH /opt/conda/envs/env/bin:$PATH
3 Likes

Awesome, thanks for sharing that @Conno !

I'm using a Macbook M1 as one of my machines, and spaCy v3 does work well on it. I've compiled it natively and have made a small extension to delegate matrix multiplications to Apple's Accelerate library. I had to compile some libraries locally (notably numpy) to make this work though.

I expect it'll still be a couple of months before the rest of the Python ecosystem supports M1 seamlessly, so in the meantime using the emulation is a good option. We'll also aim to have a guide for setting things up on Apple Silicon once the new Prodigy release is out. It does require spaCy v3, so it's not practical to do for the current version.

1 Like

Thanks @Conno for the extremely useful Dockerfile! :sunglasses: I especially love the volume trick you added so we don't need to keep firing up a new container

I had to make minor adjustments to fix the following bind issue that occurred on my machine.

ERROR:    [Errno 99] error while attempting to bind on address ('::1', 8080, 0, 0): cannot assign requested address

Dockerfile

# Dockerfile for prodigy using conda so you can run on Apple M1.
# Author: Christopher Connolly, Dylan Vanmali
# Date: 26 Feb 2021
#
# Instructions:
# Place your linux-wheel (prodigy-1.8.5-cp35.cp36.cp37-cp35m.cp36m.cp37m-linux_x86_64.whl) in same directoty as this dockerfile.
#
# Then run:
# $ docker build . -t prodigy
# $ docker run -it -p 9001:8080 -v "$(pwd):/work" prodigy bash
FROM continuumio/miniconda3
WORKDIR /app

# Create the environment:
COPY environment.yml .
RUN conda env create -f environment.yml

# Make RUN commands use the new environment:
SHELL ["conda", "run", "-n", "myenv", "/bin/bash", "-c"]

# Install Prodigy Application
RUN mkdir /prodigy
WORKDIR /prodigy
ENV PRODIGY_HOME /prodigy

COPY ./prodigy-1.10.6-cp36.cp37.cp38-cp36m.cp37m.cp38-linux_x86_64.whl /prodigy
RUN pip install prodigy-1.10.6-cp36.cp37.cp38-cp36m.cp37m.cp38-linux_x86_64.whl

# Place the prodigy.json file in the PRODIGY_HOME folder
COPY prodigy.json ${PRODIGY_HOME}/prodigy.json

# Make sure the environment is activated:
RUN echo "Make sure spacy is installed:"
RUN python -c "import spacy"

# Expose services
EXPOSE 8080
RUN mkdir /work
WORKDIR /work

# Use bash as the shell and activate the environment on load
SHELL ["/bin/bash", "-c"]
RUN echo "source activate myenv" > ~/.bashrc
ENV PATH /opt/conda/envs/env/bin:$PATH

Also add the following prodigy.json file at the same level as the Dockerfile and environment.yml files

{
    "host": "0.0.0.0"
}

Pydantic updated versions today so the program may complain that it can't update Schema. Temporary fix until the Prodigy Wheels are updated, run the following command inside the virtual environment:

$ pip3 install pydantic==1.7.3

@adriane I'm trying to run the code in my venv just as you did and I still get the issue "is not a supported wheel on this platform"