coreferee: Cannot install on Apple Silicon

I am trying to install this library on macOS 11 on an Apple Silicon Mac. The requirements seem to conflict no matter what I try.

The following are all the things I’ve tried. It would be great if you provided a way to install from source because I got M1 tensorflow and spacy to work just fine. I just don’t know how to install coreferee and the respective models with the libraries that I do have available.

INFO: pip is looking at multiple versions of coreferee to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement h5py~=3.1.0 (from tensorflow-macos) (from versions: 2.2.1, 2.3.0b1, 2.3.0, 2.3.1, 2.4.0b1, 2.4.0, 2.5.0, 2.6.0, 2.7.0rc2, 2.7.0, 2.7.1, 2.8.0rc1, 2.8.0, 2.9.0rc1, 2.9.0, 2.10.0, 3.0.0rc1, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.3.0, 3.4.0, 3.5.0, 3.6.0)
ERROR: No matching distribution found for h5py~=3.1.0

I tried building h5py from source using the home-brew version using HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.12.1 pip3.9 install --no-binary=h5py h5py==3.1.0 because there was no prebuilt binary available. That worked.

But installing carefree doesn’t seem to see this version, and I wind up with the error above. I very much depend on this library. It would be great if we could get this working again. How can the issue be resolved?

I think it’s a problem with several libraries including tensorflow.

EDIT: I tried installing the intel python3.9 hoping Rosetta would force everything to work under x86_64 emulation mode. Everything installed except for: python3 -m coreferee install en, which yielded “zsh: illegal hardware instruction”.

EDIT2: I noticed that 1.1.1 was explicitly for resolving Apple Silicon issues. Why am I experiencing these installation problems then? Is there something subtle that I am missing?

I’m out of ideas.

EDIT3: This is the official tensorflow instructions for Apple Silicon link , but the procedure requires Conda. I’d still like to know what is going wrong if you were successful in installing on Apple Silicon for v. 1.1.1. Spacy seems to be having trouble with transformers too.

EDIT4: It took a while, but I got things working by just ignoring using pip and just downloading the repo and dependencies separately using whatever is recommended for mac:


curl -O https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
./Miniforge3-MacOSX-arm64.sh
conda config --set auto_activate_base false
conda create --name my_env python=3.9
conda activate my_env
conda install rust 
export CARGO_BUILD_TARGET="aarch64-apple-darwin"
conda install -c conda-forge spacy=3.1.4

python -m spacy download en_core_web_trf
python -m spacy download en_core_web_lg

conda install -c apple tensorflow-deps
pip install tensorflow-macos
pip install tensorflow-metal
git clone https://github.com/msg-systems/coreferee.git
mv ./coreferee ./coreferee_container
cd ./coreferee_container
python -m coreferee install en
cd ..

I hope this process becomes simpler. Also, hopefully you’ll update to spacy 3.20.


OLD: I get this error on macOS 11.3 on an M1 (ARM) machine when I try installing:

pip3 install coreferee
python3 -m coreferee install en
ERROR: Cannot install coreferee==1.1.0, coreferee==1.1.1 and coreferee==1.1.2 because these package versions have conflicting dependencies.

The conflict is caused by:
    coreferee 1.1.2 depends on tensorflow-macos~=2.6.0; platform_system == "Darwin"
    coreferee 1.1.1 depends on tensorflow-macos~=2.6.0; platform_system == "Darwin"
    coreferee 1.1.0 depends on tensorflow~=2.5.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

How can I resolve this?

Also, I am using python 3.10, but the same thing happens with 3.9. I am also hoping Spacy 3.2 support is around the corner.

EDIT: I specified an older version of coreferee (1.1.0), but now I get:

ERROR: Could not find a version that satisfies the requirement tensorflow~=2.5.0 (from coreferee) (from versions: none)
ERROR: No matching distribution found for tensorflow~=2.5.0

It seems a lot of these package requirements don’t exist. I really depend on this project. How can we get it working?

EDIT: It looks like the issue is h5py. There’s no pre-built wheel for it on ARM Macs. It’s unclear how to install it from source for this purpose.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17

Most upvoted comments

I’m not part of coreferee unfortunately 😞 but I thought that Edit 4 suggested things were working now. I’m currently stuck trying to get it running myself.

No, unfortunately it’s not resolved. I had to install from source and do a bunch of painful things externally using mac-specific “hacks.” pip installation completely fails due to the tensorflow dependency, and I had to use conda. Also, the fact that only Spacy < 3.2 is supported seems to prevent gpu acceleration or something. I hope this can be resolved and potentially updated for compatibility with 3.2.

I’m not sure this is resolved. Coreferee installation on macOS using the ARM chips still fails. Are you planning on supporting that platform officially? Also, do you anticipate supporting the latest Spacy?