Installation of CellProfiler 4 from source on M1 Macs - 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 req
brew install freetype mysql
-
Direct to brew openssl
export LDFLAGS="-L$(brew --prefix)/opt/openssl/lib"
-
Install hdf5
brew install [email protected]
-
Make sure to get the version directory correct for the version installed. Find with
ls /opt/homebrew/Cellar/hdf5/
export HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.12.1_1/
-
Install wxPython dev build (4.1.2)
- Download dev build of wxPython here: https://wxpython.org/Phoenix/snapshot-builds/
- Download the latest build with the filename format: wxPython-4.1.2a1.devXXXX+XXXXXXXX.tar.gz
- Ignore the
.whl
files
- Then, extract wxPython and navigate into the wxPython folder. Install with:
- wxPython install can take a while
- attrdict and sip are required to build wxPython
pip3 install attrdict sip==5.5.0 pip3 install .
-
Install CellProfiler and CellProfiler-core from source
git clone https://github.com/CellProfiler/core cd core pip3 install .
git clone https://github.com/CellProfiler/CellProfiler cd CellProfiler
-
Edit CellProfiler setup.py and comment out the wxPython requirement since we're using a different build
install_requires=[ # "cellprofiler-core==4.2.1" ... "scipy>=1.4.1", "six", # "wxPython==4.1.0", ...
-
From inside the CellProfiler directory, install with
pip3 install -e .
-
In the CellProfiler directory, start CellProfiler with:
python3 -m cellprofiler
Conda installation
-
Install java and set up
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
-
Create a Python3.8 environment with conda
conda create --name cellprofiler python=3.8
-
Activate the conda environment
conda activate cellprofiler
-
Install wxPython dev build (4.1.2)
- Download dev build of wxPython here: https://wxpython.org/Phoenix/snapshot-builds/
- wxPython 4.1.2 is not currently available through pip
- Download the latest build with the filename format: wxPython-4.1.2a1.devXXXX+XXXXXXXX.tar.gz
- Ignore the
.whl
files
- Then, extract wxPython and navigate into the wxPython folder. Install with:
- wxPython install can take a while
- attrdict and sip are required to build wxPython
pip3 install attrdict sip==5.5.0 pip3 install .
- Download dev build of wxPython here: https://wxpython.org/Phoenix/snapshot-builds/
-
Clone and install CellProfiler-core
git clone https://github.com/CellProfiler/core pip install -e ./core
-
Clone CellProfiler
git clone https://github.com/CellProfiler/CellProfiler
-
Modify the setup.py in the cloned CellProfiler repo.
- Comment out cellprofiler-core and wxpython from the install_requires section, since we are installing our own versions from source:
... "boto3>=1.12.28", # "cellprofiler-core==4.2.1", "centrosome==1.2.0", ... "six", # "wxPython==4.1.0",
-
Install CellProfiler
pip install -e ./CellProfiler
-
Install additional dependencies
# python.app for pythonw conda install java h5py mysqlclient python.app
-
Open CellProfiler
- Execute this command from within the cloned CellProfiler repo (get there with
cd CellProfiler
)
pythonw -m cellprofiler
- Execute this command from within the cloned CellProfiler repo (get there with