Installation of CellProfiler 4 from source on MacOS M1 - CellProfiler/CellProfiler GitHub Wiki
Below are two sets of installation instructions for installation of CellProfiler from source on Macs using the new Apple M1 processor.
- Install homebrew Python
- Install CellProfiler inside a conda environment
- For less conflict problems, it is recommended to follow the conda installation
Brew Python installation
-
Install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Update brew
brew update
-
Install python 3.8
brew install [email protected] echo export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH" >> ~/.zshrc
-
Install Java
brew install java
-
For the system Java wrappers to find this JDK, symlink it with
sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
-
Set version in zshrc
echo "export JAVA_HOME=\"\$(/usr/libexec/java_home -v 1.8)\"" >> ~/.zshrc source ~/.zshrc
-
Brew install the packages requirements
brew install freetype mysql
-
Direct to brew openssl
export LDFLAGS="-L$(brew --prefix)/opt/openssl/lib"
-
Install hdf5
brew install hdf5
-
Make sure to get the version directory correct for the version installed. Find with
ls $(brew --prefix)/Cellar/hdf5
export HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.14.1/
-
Install cellprofiler
pip3 install "cellprofiler==4.2.6"
-
In the CellProfiler directory, start CellProfiler with:
python3 -m cellprofiler
Conda installation
These are instructions to install CellProfiler 4.2.5 and they may need to be modified accordingly to install other versions.
-
Create a Python 3.8 environment with conda
conda create --name cellprofiler -y python=3.8
-
Activate the conda environment
conda activate cellprofiler
-
Install java with conda
conda install openjdk
-
Install dependencies from conda
- python.app is required for pythonw
conda install libgfortran h5py mysqlclient python.app
-
Install CellProfiler
pip install "cellprofiler==4.2.6"
-
Run CellProfiler from within its directory
- Execute this command (note the w after python, this uses the
python.app
package from step 2)
pythonw -m cellprofiler
- Execute this command (note the w after python, this uses the